Esempio n. 1
0
 def test_request_with_include(self):
     """
     Confirm we request the status when asked to
     """
     request = StudySubjectsRequest(self.project_name, self.environment, include="inactive")
     self.assertTrue("include=inactive" in request.url_path())
     request = StudySubjectsRequest(self.project_name, self.environment, include="inactiveAndDeleted")
     self.assertTrue("include=inactiveAndDeleted" in request.url_path())
     request = StudySubjectsRequest(self.project_name, self.environment, include="deleted")
     self.assertTrue("include=deleted" in request.url_path())
     with self.assertRaises(ValueError) as err:
         request = StudySubjectsRequest(self.project_name, self.environment, include="kitchen_sink")
     self.assertEqual("If provided, included must be one of inactive,deleted,inactiveAndDeleted",
                      err.exception.message)
Esempio n. 2
0
 def test_request_uuid_type(self):
     """
     Confirm we request the UUID Subject Key Type
     """
     request = StudySubjectsRequest(self.project_name, self.environment,
                                    subject_key_type="SubjectUUID")
     self.assertTrue("subjectKeyType=SubjectUUID" in request.url_path())
Esempio n. 3
0
 def test_request_with_status(self):
     """
     Confirm we request the status when asked to
     """
     request = StudySubjectsRequest(self.project_name,
                                    self.environment,
                                    status=True)
     self.assertTrue("status=all" in request.url_path())
Esempio n. 4
0
 def test_request_uuid_type(self):
     """
     Confirm we request the UUID Subject Key Type
     """
     request = StudySubjectsRequest(self.project_name,
                                    self.environment,
                                    subject_key_type="SubjectUUID")
     self.assertTrue("subjectKeyType=SubjectUUID" in request.url_path())
Esempio n. 5
0
 def test_request_with_include(self):
     """
     Confirm we request the status when asked to
     """
     request = StudySubjectsRequest(self.project_name,
                                    self.environment,
                                    include="inactive")
     self.assertTrue("include=inactive" in request.url_path())
     request = StudySubjectsRequest(self.project_name,
                                    self.environment,
                                    include="inactiveAndDeleted")
     self.assertTrue("include=inactiveAndDeleted" in request.url_path())
     request = StudySubjectsRequest(self.project_name,
                                    self.environment,
                                    include="deleted")
     self.assertTrue("include=deleted" in request.url_path())
     with self.assertRaises(ValueError) as err:
         request = StudySubjectsRequest(self.project_name,
                                        self.environment,
                                        include="kitchen_sink")
     self.assertEqual(
         "If provided, included must be one of inactive,deleted,inactiveAndDeleted",
         str(err.exception))
Esempio n. 6
0
 def test_request_without_type(self):
     """
     Confirm we request the UUID Subject Key Type
     """
     request = StudySubjectsRequest(self.project_name, self.environment)
     self.assertFalse("subjectKeyType" in request.url_path())
Esempio n. 7
0
 def test_request_with_status(self):
     """
     Confirm we request the status when asked to
     """
     request = StudySubjectsRequest(self.project_name, self.environment, status=True)
     self.assertTrue("status=all" in request.url_path())
Esempio n. 8
0
 def test_request_without_type(self):
     """
     Confirm we request the UUID Subject Key Type
     """
     request = StudySubjectsRequest(self.project_name, self.environment)
     self.assertFalse("subjectKeyType" in request.url_path())