def test_space_nested(): for x in range(0, 10): root = tcommon.getRandStr(chars=' ') prefix = root for i in range(0, 32): prefix += '/{}'.format(tcommon.getRandStr(chars=' ')) assert common.sendData('CREATE "{}/obj"'.format(prefix)) == ["OK"] # create empty object assert common.sendData('DELETE "{}/obj"'.format(prefix)) == ["OK"] # destroy object assert common.sendData('DELETE "{}"'.format(prefix)) == ["OK"] # destroy container
def test_create_del_longnames_nested(): root = tcommon.getRandStr(size=65) for x in range(0, 10): prefix = root # create 32 nested levels, each one with a 65 char length empty object name for i in range(0, 32): prefix += '/{}'.format(tcommon.getRandStr(size=65)) assert common.sendData('CREATE "{}/obj"'.format(prefix)) == ["OK"] # create empty object assert common.sendData('DELETE "{}/obj"'.format(prefix)) == ["OK"] # destroy object assert common.sendData('DELETE "{}"'.format(prefix)) == ["OK"] # destroy container assert common.sendData('DELETE "{}"'.format(root)) == ["OK"] # destroy root container
def test_alpha(): assert tcommon.telnet() == True for x in range(0, 10): prefix = tcommon.getRandStr(chars=string.ascii_uppercase + string.ascii_lowercase) assert common.sendData('CREATE "{}/obj"'.format(prefix)) == ["OK"] # create empty object assert common.sendData('DELETE "{}/obj"'.format(prefix)) == ["OK"] # destroy object assert common.sendData('DELETE "{}"'.format(prefix)) == ["OK"] # destroy container
def test_localscale_int(): prefix = tcommon.getRandStr() assert tcommon.telnet() == True assert common.sendData( 'CREATE "{}/obj"'.format(prefix)) == ["OK"] # create empty object assert common.sendData( '"{}/obj" SET Transform localScale (0 32000 65000)'.format( prefix)) == ["OK"] # set object scale assert common.sendData( '"{}/obj" GET Transform localScale'.format(prefix)) == [ '[0.0,32000.0,65000.0]', "OK" ] # get object scale assert common.sendData( 'DELETE "{}"'.format(prefix)) == ["OK"] # destroy object
def test_localscale_float(): prefix = tcommon.getRandStr() assert tcommon.telnet() == True assert common.sendData( 'CREATE "{}/obj"'.format(prefix)) == ["OK"] # create empty object assert common.sendData( '"{}/obj" SET Transform localScale (-6.101 1.101 -50.101)'.format( prefix)) == ["OK"] # set object scale assert common.sendData( '"{}/obj" GET Transform localScale'.format(prefix)) == [ '[-6.101,1.101,-50.101]', "OK" ] # get object scale assert common.sendData( 'DELETE "{}"'.format(prefix)) == ["OK"] # destroy object
def test_localeulerangles_float(): prefix = tcommon.getRandStr() assert tcommon.telnet() == True assert common.sendData( 'CREATE "{}/obj"'.format(prefix)) == ["OK"] # create empty object assert common.sendData( '"{}/obj" SET Transform eulerAngles (0 0 0) localEulerAngles (-6.101 1.101 -50.101)' .format(prefix)) == ["OK"] # set object eulerAngles assert common.sendData( '"{}/obj" GET Transform localEulerAngles'.format(prefix)) == [ '[353.899,1.101,309.899]', "OK" ] # get object eulerAngles assert common.sendData( 'DELETE "{}"'.format(prefix)) == ["OK"] # destroy object
def test_eulerangles_int(): prefix = tcommon.getRandStr() assert tcommon.telnet() == True assert common.sendData( 'CREATE "{}/obj"'.format(prefix)) == ["OK"] # create empty object assert common.sendData( '"{}/obj" SET Transform eulerAngles (0 90 180)'.format(prefix)) == [ "OK" ] # set object eulerAngles assert common.sendData( '"{}/obj" GET Transform eulerAngles'.format(prefix)) == [ '[0.0,90.0,180.0]', "OK" ] # get object eulerAngles assert common.sendData( 'DELETE "{}"'.format(prefix)) == ["OK"] # destroy object
def test_rectangle(): prefix = tcommon.getRandStr() assert tcommon.telnet() == True assert common.sendData('CREATE "{}/spawner/drone/container"'.format(prefix)) == ["OK"] assert common.sendData('"{}/spawner/drone/container" SET active false'.format(prefix)) == ["OK"] assert common.sendData('"{}/spawner/drone/container" ADD RandomProps.Rectangle'.format(prefix)) == ["OK"] assert common.sendData('"{}/spawner/drone/container" ADD RandomProps.PropArea'.format(prefix)) == ["OK"] assert common.sendData('"{}/spawner/drone/container" SET RandomProps.PropArea tags "drone"'.format(prefix)) == ["OK"] assert common.sendData('"{}/spawner/drone/container" SET RandomProps.PropArea async false numberOfProps 25 collisionCheck false stickToGround false'.format(prefix)) == ["OK"] # assert common.sendData('"{}/spawner/drone/container" SET RandomProps.Rectangle size (0 0)'.format(prefix)) == ["OK"] assert common.sendData('"{}/spawner/drone/container" SET RandomProps.Rectangle size (10 10)'.format(prefix)) == ["OK"] assert common.sendData('"{}/spawner/drone/container" SET Transform position (0 0 0) eulerAngles (0 0 0) localScale (1 1 1)'.format(prefix)) == ["OK"] assert common.sendData('"{}/spawner/drone/container" SET active true'.format(prefix)) == ["OK"] assert common.sendData('"{}/spawner/drone" SET active true'.format(prefix)) == ["OK"] assert common.sendData('DELETE "{}"'.format(prefix)) == ["OK"] # destroy container
import time import re from syncity import common, settings_manager settings = settings_manager.Singleton() objs = {} fns = {} testSizes = [] # minimum rendering size is 64x64 # unity rendering will break when going from a small size to 1024, however, # this will happen at random, that's why this tests repeats 3 times for i in range(0, 3): # for l in [[64, 64], [128, 64], [64, 128], [1024, 768], [768, 1024], [4096, 4096], [640, 480], [320, 240], [64, 128]]: for l in [[1024, 768]]: testSizes.append((l[0], l[1], tcommon.getRandStr())) def cleanup(gprefix): tcommon.cleanup(objs[gprefix], fns[gprefix]) @pytest.mark.first @pytest.mark.dependency @pytest.mark.parametrize("width,height,gprefix", testSizes) def test_disk_export_setup(width, height, gprefix): assert tcommon.telnet() == True tcommon.setConfig() objs[gprefix] = [gprefix] fns[gprefix] = [] objs[gprefix].append('{}/disk1'.format(gprefix))
def test_create_del_longnames(): for x in range(0, 10): prefix = tcommon.getRandStr(size=257) assert common.sendData('CREATE "{}/obj"'.format(prefix)) == ["OK"] # create empty object assert common.sendData('DELETE "{}/obj"'.format(prefix)) == ["OK"] # destroy object assert common.sendData('DELETE "{}"'.format(prefix)) == ["OK"] # destroy container
def test_digits_long(): for x in range(0, 10): prefix = tcommon.getRandStr(size=257, chars=string.digits) assert common.sendData('CREATE "{}/obj"'.format(prefix)) == ["OK"] # create empty object assert common.sendData('DELETE "{}/obj"'.format(prefix)) == ["OK"] # destroy object assert common.sendData('DELETE "{}"'.format(prefix)) == ["OK"] # destroy container