def test_building(self, mockcat): __main__.run() self.options.args = "33333 -b" self.assertTrue(mockcat.called) options = mockcat.call_args_list[0][0][1] self.options.address = False self.compareOptions(options)
def test_download(self, mockcat): cat = mock.MagicMock() mockcat.return_value = cat __main__.run() self.options.args = "-w 33333" mockcat.assert_called_once_with("33333") cat.download.assert_has_calls([ mock.call("address"), mock.call("cadastralzoning"), mock.call("building"), ])
def test_list_error(self, mocklog): __main__.run() self.assertTrue(mocklog.called)
def test_default(self, mockcat): __main__.run() self.assertTrue(mockcat.called) self.assertEqual(mockcat.call_args_list[0][0][0], "33333") options = mockcat.call_args_list[0][0][1] self.compareOptions(options)
def test_too_many_args(self, mocklog): __main__.run() output = mocklog.call_args_list[0][0][0] self.assertIn("Can't use split file", output)