def test_synchronise_with_codelists(self): importer = CodeListImporter() importer.get_codelist_data = MagicMock() importer.loop_through_codelists = MagicMock() importer.synchronise_with_codelists() self.assertEqual(9, importer.get_codelist_data.call_count) self.assertEqual(len(importer.iati_versions), importer.loop_through_codelists.call_count) importer.get_codelist_data.assert_called_with(name='DocumentCategory-category') importer.loop_through_codelists.assert_called_with('2.01')
def test_synchronise_with_codelists(self): importer = CodeListImporter() importer.get_codelist_data = MagicMock() importer.loop_through_codelists = MagicMock() importer.synchronise_with_codelists() self.assertEqual(10, importer.get_codelist_data.call_count) self.assertEqual(len(importer.iati_versions), importer.loop_through_codelists.call_count) importer.get_codelist_data.assert_called_with( name='DocumentCategory-category') importer.loop_through_codelists.assert_called_with('2.02')
def test_synchronise_with_codelists(self): importer = CodeListImporter() importer.get_codelist_data = MagicMock() importer.loop_through_codelists = MagicMock() importer.synchronise_with_codelists() self.assertEqual(len(importer.CODELIST_ITEMS_TO_PARSE), importer.get_codelist_data.call_count) self.assertEqual(len(importer.iati_versions), importer.loop_through_codelists.call_count) last_synced_codelist = importer.CODELIST_ITEMS_TO_PARSE[ len(importer.CODELIST_ITEMS_TO_PARSE) - 1] importer.get_codelist_data.assert_called_with( name=last_synced_codelist) importer.loop_through_codelists.assert_called_with('2.03')
def test_synchronise_with_codelists(self): importer = CodeListImporter() importer.get_codelist_data = MagicMock() importer.loop_through_codelists = MagicMock() importer.synchronise_with_codelists() self.assertEqual( len(importer.CODELIST_ITEMS_TO_PARSE), importer.get_codelist_data.call_count ) self.assertEqual(len(importer.iati_versions), importer.loop_through_codelists.call_count) last_synced_codelist = importer.CODELIST_ITEMS_TO_PARSE[ len(importer.CODELIST_ITEMS_TO_PARSE) - 1 ] importer.get_codelist_data.assert_called_with( name=last_synced_codelist ) importer.loop_through_codelists.assert_called_with('2.03')