def test_create_eq_constructor_missing_case_id(self):
        case_json = self.case_json.copy()
        del case_json['id']

        with self.assertRaises(InvalidEqPayLoad) as ex:
            EqPayloadConstructor(case_json, self.app, self.iac_code)
        self.assertIn('No case id in supplied case JSON', ex.exception.message)
Пример #2
0
    def test_create_eq_constructor_missing_case_id(self):
        uac_json = self.uac_json_e.copy()
        del uac_json['caseId']

        with self.assertRaises(InvalidEqPayLoad) as ex:
            EqPayloadConstructor(uac_json, self.attributes_en, self.app, None)
        self.assertIn('No case id in supplied case JSON', ex.exception.message)
    def test_create_eq_constructor_missing_sample_unit_id(self):
        case_json = self.case_json.copy()
        del case_json["sampleUnitId"]

        with self.assertRaises(InvalidEqPayLoad) as ex:
            EqPayloadConstructor(case_json, self.app, self.iac_code)
        self.assertIn(f'No sample unit id for case {self.case_id}',
                      ex.exception.message)
    def test_create_eq_constructor_missing_ce_id(self):
        case_json = self.case_json.copy()
        del case_json["caseGroup"]["collectionExerciseId"]

        with self.assertRaises(InvalidEqPayLoad) as ex:
            EqPayloadConstructor(case_json, self.app, self.iac_code)
        self.assertIn(f'No collection id for case id {self.case_id}',
                      ex.exception.message)
Пример #5
0
    def test_create_eq_constructor_missing_uprn(self):
        uac_json = self.uac_json_e.copy()
        del uac_json['address']['uprn']

        with self.assertRaises(InvalidEqPayLoad) as ex:
            EqPayloadConstructor(uac_json, self.attributes_en, self.app, None)
            self.assertIn(f'Could not retrieve address uprn from case JSON',
                          ex.exception.message)
    def test_create_eq_constructor_missing_ci_id(self):
        case_json = self.case_json.copy()
        del case_json['collectionInstrumentId']

        with self.assertRaises(InvalidEqPayLoad) as ex:
            EqPayloadConstructor(case_json, self.app, self.iac_code)
        self.assertIn(
            f'No collectionInstrumentId value for case id {self.case_id}',
            ex.exception.message)
    def test_create_eq_constructor_missing_sample_unit_ref(self):
        case_json = self.case_json.copy()
        del case_json['caseGroup']['sampleUnitRef']

        with self.assertRaises(InvalidEqPayLoad) as ex:
            EqPayloadConstructor(case_json, self.app, self.iac_code)
        self.assertIn(
            f'Could not retrieve sample unit ref for case {self.case_id}',
            ex.exception.message)
    def test_create_eq_constructor_missing_iac(self):
        iac_code = ''

        with self.assertRaises(InvalidEqPayLoad) as ex:
            EqPayloadConstructor(self.case_json, self.app, iac_code)
        self.assertIn('IAC is empty', ex.exception.message)
 def test_create_eq_constructor(self):
     self.assertIsInstance(
         EqPayloadConstructor(self.case_json, self.app, self.iac_code),
         EqPayloadConstructor)
Пример #10
0
 def test_create_eq_constructor(self):
     self.assertIsInstance(
         EqPayloadConstructor(self.uac_json_e, self.attributes_en, self.app,
                              None), EqPayloadConstructor)