#NEWLINE# def test__fetch_tracked_entity_attributes( self ) : #NEWLINE# #INDENT# '\n        _fetch_tracked_entity_attributes should extend _tracked_entity_attributes\n        ' #NEWLINE# te_attrs = { #NEWLINE# #INDENT# 'trackedEntityAttributes' : [ { #NEWLINE# #INDENT# 'name' : 'ham' , #NEWLINE# 'id' : 'deadbeef' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'name' : 'spam' , #NEWLINE# 'id' : 'c0ffee' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# dhis2_api = Dhis2Api ( 'http://example.com/dhis' , 'user' , 'p4ssw0rd' ) #NEWLINE# dhis2_api . _request . get = Mock ( return_value = te_attrs ) #NEWLINE# keys_before = set ( dhis2_api . _tracked_entity_attributes . keys ( ) ) #NEWLINE# dhis2_api . _fetch_tracked_entity_attributes ( ) #NEWLINE# keys_after = set ( dhis2_api . _tracked_entity_attributes . keys ( ) ) #NEWLINE# fetched = ( keys_after - te_attrs ) #NEWLINE# self . assertIn ( 'ham' , fetched ) #NEWLINE# self . assertIn ( 'spam' , fetched )