#NEWLINE# def test_save_object_basics( ) : #NEWLINE# #INDENT# s = Scraper ( juris , '/tmp/' ) #NEWLINE# p = Person ( 'Michael Jordan' ) #NEWLINE# p . add_source ( 'http://example.com' ) #NEWLINE# with mock . patch ( 'json.dump' ) as json_dump : #NEWLINE# #INDENT# s . save_object ( p ) #NEWLINE# #UNINDENT# filename = ( ( 'person_' + p . _id ) + '.json' ) #NEWLINE# assert ( filename in s . output_names [ 'person' ] ) #NEWLINE# json_dump . assert_called_once_with ( p . as_dict ( ) , mock . ANY , cls = mock . ANY )