コード例 #1
0
ファイル: test_api.py プロジェクト: dralley/pulp-smash
 def test_202_check_run(self):
     """Assert HTTP 202 responses are treated specially."""
     kwargs = {key: mock.Mock() for key in _HANDLER_ARGS}
     with mock.patch.object(api, '_handle_202') as handle_202:
         api.safe_handler(**kwargs)
     self.assertEqual(handle_202.call_count, 1)
コード例 #2
0
ファイル: test_api.py プロジェクト: dralley/pulp-smash
 def test_return(self):
     """Assert the passed-in ``response`` is returned."""
     kwargs = {key: mock.Mock() for key in _HANDLER_ARGS}
     self.assertIs(kwargs['response'], api.safe_handler(**kwargs))
コード例 #3
0
ファイル: test_api.py プロジェクト: dralley/pulp-smash
 def test_raise_for_status(self):
     """Assert ``response.raise_for_status()`` is called."""
     kwargs = {key: mock.Mock() for key in _HANDLER_ARGS}
     api.safe_handler(**kwargs)
     self.assertEqual(kwargs['response'].raise_for_status.call_count, 1)
コード例 #4
0
ファイル: test_api.py プロジェクト: Telekom-PD/pulp-smash
 def test_raise_for_status(self):
     """Assert ``response.raise_for_status()`` is called."""
     kwargs = {key: mock.Mock() for key in ('server_config', 'response')}
     api.safe_handler(**kwargs)
     self.assertEqual(kwargs['response'].raise_for_status.call_count, 1)
コード例 #5
0
ファイル: test_api.py プロジェクト: Telekom-PD/pulp-smash
 def test_202_check_run(self):
     """Assert HTTP 202 responses are treated specially."""
     kwargs = {key: mock.Mock() for key in ('server_config', 'response')}
     with mock.patch.object(api, '_handle_202') as handle_202:
         api.safe_handler(**kwargs)
     self.assertEqual(handle_202.call_count, 1)
コード例 #6
0
ファイル: test_api.py プロジェクト: Telekom-PD/pulp-smash
 def test_return(self):
     """Assert the passed-in ``response`` is returned."""
     kwargs = {key: mock.Mock() for key in ('server_config', 'response')}
     self.assertIs(kwargs['response'], api.safe_handler(**kwargs))
コード例 #7
0
 def test_return(self):
     """Assert the passed-in ``response`` is returned."""
     kwargs = {key: mock.Mock() for key in ('server_config', 'response')}
     self.assertIs(kwargs['response'], api.safe_handler(**kwargs))
コード例 #8
0
ファイル: test_api.py プロジェクト: tools-hub/pulp-smash
 def test_202_check_run(self):
     """Assert HTTP 202 responses are treated specially."""
     kwargs = {key: mock.Mock() for key in _HANDLER_ARGS}
     with mock.patch.object(api, "_handle_202") as handle_202:
         api.safe_handler(**kwargs)
     self.assertEqual(handle_202.call_count, 1)
コード例 #9
0
ファイル: test_api.py プロジェクト: tools-hub/pulp-smash
 def test_raise_for_status(self):
     """Assert ``response.raise_for_status()`` is called."""
     kwargs = {key: mock.Mock() for key in _HANDLER_ARGS}
     api.safe_handler(**kwargs)
     self.assertEqual(kwargs["response"].raise_for_status.call_count, 1)
コード例 #10
0
ファイル: test_api.py プロジェクト: tools-hub/pulp-smash
 def test_return(self):
     """Assert the passed-in ``response`` is returned."""
     kwargs = {key: mock.Mock() for key in _HANDLER_ARGS}
     self.assertIs(kwargs["response"], api.safe_handler(**kwargs))