Пример #1
0
 def test_preprocess_bogus(self, mock_requests_head, mock_isfile):
     mock_isfile.return_value = False
     mock_requests_head.return_value = mock.Mock(status_code=500)
     self.assertRaises(exceptions.InvalidScenarioArgument,
                       types.PathOrUrl({}, {}).pre_process, "fake_path", {})
     mock_requests_head.assert_called_once_with("fake_path")
Пример #2
0
 def test_preprocess_url(self, mock_requests_head, mock_isfile):
     mock_isfile.return_value = False
     mock_requests_head.return_value = mock.Mock(status_code=200)
     path = types.PathOrUrl({}, {}).pre_process("fake_url", {})
     self.assertEqual("fake_url", path)
Пример #3
0
 def test_preprocess_file(self, mock_requests_head, mock_isfile):
     mock_isfile.return_value = True
     path = types.PathOrUrl({}, {}).pre_process("fake_path", {})
     self.assertEqual("fake_path", path)