Added test and json data for new check_study pb mock api endpoint
This commit is contained in:
parent
9690c69b6c
commit
2cb2874a49
|
@ -0,0 +1,3 @@
|
|||
[
|
||||
{"DETAIL": "Passed validation.", "STATUS": "No Error"}
|
||||
]
|
|
@ -72,3 +72,13 @@ class TestProtocolBuilder(BaseTest):
|
|||
self.assertEqual('IRB Event 1', response[0]["IRBEVENT"])
|
||||
self.assertEqual('IRB Event 2', response[1]["IRBEVENT"])
|
||||
self.assertEqual('IRB Event 3', response[2]["IRBEVENT"])
|
||||
|
||||
@patch('crc.services.protocol_builder.requests.get')
|
||||
def test_check_study(self, mock_get):
|
||||
app.config['PB_ENABLED'] = True
|
||||
mock_get.return_value.ok = True
|
||||
mock_get.return_value.text = self.protocol_builder_response('check_study.json')
|
||||
response = ProtocolBuilderService.check_study(self.test_study_id)
|
||||
self.assertIsNotNone(response)
|
||||
self.assertIn('DETAIL', response[0].keys())
|
||||
self.assertIn('STATUS', response[0].keys())
|
||||
|
|
Loading…
Reference in New Issue