#NEWLINE# def test_dt_map( self ) : #NEWLINE# #INDENT# btype = self . client . bucket_type ( 'maps' ) #NEWLINE# bucket = btype . bucket ( self . bucket_name ) #NEWLINE# mymap = datatypes . Map ( bucket , self . key_name ) #NEWLINE# mymap . counters [ 'a' ] . increment ( 2 ) #NEWLINE# mymap . registers [ 'b' ] . assign ( 'testing' ) #NEWLINE# mymap . flags [ 'c' ] . enable ( ) #NEWLINE# mymap . maps [ 'd' ] [ ( 'e' , 'set' ) ] . add ( 'deep value' ) #NEWLINE# mymap . store ( ) #NEWLINE# othermap = bucket . get ( self . key_name ) #NEWLINE# self . assertIn ( 'a' , othermap . counters ) #NEWLINE# self . assertIn ( 'b' , othermap . registers ) #NEWLINE# self . assertIn ( 'c' , othermap . flags ) #NEWLINE# self . assertIn ( 'd' , othermap . maps ) #NEWLINE# self . assertEqual ( 2 , othermap . counters [ 'a' ] . value ) #NEWLINE# self . assertEqual ( 'testing' , othermap . registers [ 'b' ] . value ) #NEWLINE# self . assertTrue ( othermap . flags [ 'c' ] . value ) #NEWLINE# self . assertEqual ( { #NEWLINE# #INDENT# ( 'e' , 'set' ) : frozenset ( [ 'deep value' ] ) , #NEWLINE# #UNINDENT# } , bucket . maps [ 'd' ] . value ) #NEWLINE# self . assertEqual ( frozenset ( [ ] ) , othermap . sets [ 'f' ] . value ) #NEWLINE# othermap . sets [ 'f' ] . add ( 'thing1' ) #NEWLINE# othermap . sets [ 'f' ] . add ( 'thing2' ) #NEWLINE# del othermap . counters [ 'a' ] #NEWLINE# othermap . store ( return_body = True ) #NEWLINE# mymap . reload ( ) #NEWLINE# self . assertNotIn ( 'a' , mymap . counters ) #NEWLINE# self . assertIn ( 'f' , mymap . sets ) #NEWLINE# self . assertItemsEqual ( [ 'thing1' , 'thing2' ] , mymap . sets [ 'f' ] . value )