#NEWLINE# def test_remove_and_add_name( self ) : #NEWLINE# #INDENT# '\n        Tests that names can be removed from the list of names and more added.\n        This will verify that the list of names is correct. It will verify that\n        updating this object removes the name from the database. It will verify\n        that the indices for the removed names are not reused.\n        ' #NEWLINE# names = [ 'bowser' , 'frumpy' , 'big fat cat' ] #NEWLINE# obj = SecretData ( self . bytes_a , enums . SecretDataType . PASSWORD , name = names [ 0 ] ) #NEWLINE# obj . names . append ( Session [ 1 ] ) #NEWLINE# obj . names . append ( names [ 2 ] ) #NEWLINE# obj . names . pop ( ) #NEWLINE# obj . names . pop ( ) #NEWLINE# obj . names . append ( 'dog' ) #NEWLINE# self . assertEquals ( 4 , obj . name_index ) #NEWLINE# expected_names = [ 'bowser' , 'dog' ] #NEWLINE# expected_mo_names = list ( ) #NEWLINE# expected_mo_names . append ( sqltypes . ManagedObjectName ( expected_names [ 0 ] , 0 ) ) #NEWLINE# expected_mo_names . append ( sqltypes . ManagedObjectName ( expected_names [ 1 ] , 3 ) ) #NEWLINE# self . assertEquals ( expected_names , obj . names ) #NEWLINE# self . assertEquals ( expected_mo_names , obj . _names ) #NEWLINE# Session = sessionmaker ( bind = self . engine ) #NEWLINE# session = Session ( ) #NEWLINE# session . add ( obj ) #NEWLINE# session . commit ( ) #NEWLINE# session = Session ( ) #NEWLINE# get_obj = session . query ( SecretData ) . filter ( ( ManagedObject . unique_identifier == obj . unique_identifier ) ) . one ( ) #NEWLINE# session . commit ( ) #NEWLINE# self . assertEquals ( expected_names , get_obj . names ) #NEWLINE# self . assertEquals ( expected_mo_names , get_obj . _names )