Files
o3de/Code/Tools/PythonBindingsExample/tests/test_framework.py
T
Steve Pham 38261d0800 Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
2021-07-16 15:25:48 -07:00

47 lines
1.2 KiB
Python
Executable File

"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
print ('Testing framework Python bindings')
import azlmbr.entity as entity
import azlmbr.framework as framework
import azlmbr.math as math
def test_entity_api():
entityId = entity.EntityId()
if (entityId.IsValid is None):
print('entityId.IsValid is None')
framework.Terminate(1)
if (entityId.IsValid() is True):
print('entityId.IsValid() is True')
framework.Terminate(2)
def test_math_api():
if (math.Math_IsEven(3)):
framework.Terminate(1)
if (math.Math_IsClose(1.0,2.0)):
framework.Terminate(2)
if (math.Math_IsClose(2.0, math.Math_Sqrt(4.0)) is False):
framework.Terminate(3)
def main():
import sys
print("Starting framework test")
if (sys.argv[1] == 'entity'):
test_entity_api()
elif (sys.argv[1] == 'math'):
test_math_api()
else:
print('Unknown arg {}'.format(sys.argv[0]))
framework.Terminate(4)
if __name__ == "__main__":
main()