#NEWLINE# def test_entity_version( ) : #NEWLINE# #INDENT# entity = File ( parent = project [ 'id' ] ) #NEWLINE# entity [ 'path' ] = utils . make_bogus_data_file ( ) #NEWLINE# schedule_for_cleanup ( entity [ 'path' ] ) #NEWLINE# entity = syn . createEntity ( annotations ) #NEWLINE# syn . setAnnotations ( entity , { #NEWLINE# #INDENT# 'fizzbuzz' : 111222 , #NEWLINE# #UNINDENT# } ) #NEWLINE# entity = syn . getEntity ( entity ) #NEWLINE# assert ( entity . versionNumber == 1 ) #NEWLINE# entity . foo = 998877 #NEWLINE# entity [ 'name' ] = 'foobarbat' #NEWLINE# entity [ 'description' ] = 'This is a test entity...' #NEWLINE# entity = syn . updateEntity ( entity , incrementVersion = True , versionLabel = 'Prada remix' ) #NEWLINE# assert ( entity . versionNumber == 2 ) #NEWLINE# annotations = syn . getAnnotations ( entity , version = 1 ) #NEWLINE# assert ( annotations [ 'fizzbuzz' ] [ 0 ] == 111222 ) #NEWLINE# returnEntity = syn . getEntity ( entity , version = 1 ) #NEWLINE# assert ( returnEntity . versionNumber == 1 ) #NEWLINE# assert ( returnEntity [ 'fizzbuzz' ] [ 0 ] == 111222 ) #NEWLINE# assert ( 'foo' not in returnEntity ) #NEWLINE# returnEntity = syn . getEntity ( entity ) #NEWLINE# assert ( returnEntity . versionNumber == 2 ) #NEWLINE# assert ( returnEntity [ 'foo' ] [ 0 ] == 998877 ) #NEWLINE# assert ( returnEntity [ 'name' ] == 'foobarbat' ) #NEWLINE# assert ( returnEntity [ 'description' ] == 'This is a test entity...' ) #NEWLINE# assert ( returnEntity [ 'versionLabel' ] == 'Prada remix' ) #NEWLINE# returnEntity = syn . downloadEntity ( entity , version = 1 ) #NEWLINE# assert ( returnEntity . versionNumber == 1 ) #NEWLINE# assert ( returnEntity [ 'fizzbuzz' ] [ 0 ] == 111222 ) #NEWLINE# assert ( 'foo' not in returnEntity ) #NEWLINE# syn . delete ( entity , version = 2 ) #NEWLINE# returnEntity = syn . getEntity ( entity ) #NEWLINE# assert ( returnEntity . versionNumber == 1 )