Skip to main content

Unity commands and responses for coeus-python-framework.

Project description

Coeus-Unity

pypi travis

About

Coeus-Unity is a collection of commands and assertions built on coeus-test package for python. These commands support remote integration tests in Unity with the use of the C# Coeus test framework.

Contributors

Setup

Simply install the requirement into your package.

pip install coeus-test-unity

Commands

Commands offer no response validation. You can use assertions for that.

import commands

response = commands.query_transform_exists(cli, "My/Transform Hierarchy/Object (Clone)")
response = commands.query_scene_loaded(cli, "AppSetup")
response = commands.query_renderer_visible(cli, "My/Target/Object (Clone)")

response = commands.await_transform_exists(cli, "My/Transform Hierarchy/Object (Clone)")
# Waits for renderer to become not visible based on False...
response = commands.await_renderer_visible(cli, "My/Transform Hierarchy/Object (Clone)", False)
response = commands.await_scene_loaded(cli, "AppSetup")

Assertions

Since commands only assert the response message, they don't verify the state being requested; for this we can use the assertions.

import assertions

# Fails immediately if transform doesn't exist...
assertions.assert_transform_exists(cli, "Some/Path")

# Fails immediately if scene not loaded...
assertions.assert_scene_loaded(cli, "MyScene")

# Awaits for the scene to be loaded, fails when exceeded...
assertions.assert_await_scene_loaded(cli, "MyScene")

# Awaits for a transform to exist by timeout, fails when exceeded...
assertions.assert_await_transform_exists(cli, "Some/Path", timeout_seconds=10)

# Awaits for a renderer to be visible by timeout, fails when exceeded...
assertions.assert_await_renderer_visible(cli, "Some/Path", timeout_seconds=10)

# Awaits for all transforms to exist by timeout, fails when exceeded...
assertions.assert_await_all_transforms_exist(cli, ["Some/Path1", "Some/Path2"], timeout_seconds=10)

# Awaits for any of the transforms to exist by timeout, fails when exceeded...
assertions.assert_await_any_transforms_exist(cli, ["Some/Path1", "Some/Path2"], timeout_seconds=10)

Advanced

Transform Path Variables

If your client supports variable replacement, you can simply pass them into your paths. For instance if you have different variations on transform path names based on some predictable variable, you can pass those in for replacement.

# {deviceFormfactor} is replaced in client...
assertions.assert_await_transform_exists(cli, "Kiosk-{deviceFormFactor}(Clone"), timeout_seconds=10)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coeus-test-unity-0.1.7.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

coeus_test_unity-0.1.7-py2.py3-none-any.whl (6.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file coeus-test-unity-0.1.7.tar.gz.

File metadata

  • Download URL: coeus-test-unity-0.1.7.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.14

File hashes

Hashes for coeus-test-unity-0.1.7.tar.gz
Algorithm Hash digest
SHA256 0d43ca7cd5061412b2f98921ee8e3290e7a221e390925bce45d39a691bd185f0
MD5 944941b369fa94263ae7825209bd018f
BLAKE2b-256 4c59d3d28ecbf103ecfba39e386ee8d7ab36098405bac32c30a2b6a9071b2e33

See more details on using hashes here.

File details

Details for the file coeus_test_unity-0.1.7-py2.py3-none-any.whl.

File metadata

  • Download URL: coeus_test_unity-0.1.7-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.14

File hashes

Hashes for coeus_test_unity-0.1.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 439580f93fc7a9b0886dcfdce6780a470d8786cf3a4984cc384c8568b24ad9d2
MD5 b3dcc323855c8696b70c8af81c2c0ec2
BLAKE2b-256 2a4238a3f3522cfbf80600696c8ea8c1346c76b39b06d26e9b1c5be9978a66e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page