예제 #1
0
 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)
예제 #2
0
 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"),
     ])
예제 #3
0
 def test_list_error(self, mocklog):
     __main__.run()
     self.assertTrue(mocklog.called)
예제 #4
0
 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)
예제 #5
0
 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)