Example #1
0
    def setUp(self):
        if not TestCase_Validations.is_init:
            print('init_db')
            init_db()
            TestCase_Validations.is_init = True
        self.pipeline = get_global_test_pipeline()
        self.pipe = self.pipeline.get_or_create_pipe('test_system',
                                                     config=test_system_config)
        self.pipe.register_domain(_domainmodel)
        self.pipe.mappings = []
        self.pipe.mappings.extend(init_source_to_sor_mappings())
        self.pipe.mappings.extend(init_sor_to_dv_mappings(self.pipe.sor))
        validations = []

        validation = SorValidation(tbl='patient_hstage', schema=self.pipe.sor)
        validation.msg = 'Ongeldige postcode'
        validation.sql_condition = "postcode like '0000%'"
        validations.append(validation)

        validation = SorValidation(tbl='patient_hstage', schema=self.pipe.sor)
        validation.msg = 'Ongeldig geslacht'
        validation.sql_condition = "geslacht not in ('m', 'v')"
        validations.append(validation)

        validation = DvValidation()
        validation.msg = '102 is ongeldig'
        validation.set_condition(Patient.Hub.bk == '102_test')
        validations.append(validation)

        validation = DvValidation()
        validation.msg = 'te jong'
        validation.set_condition(Patient.Default.geboortedatum >= '2000-01-01')
        validations.append(validation)

        self.pipe.validations.extend(validations)
 def setUp(self):
     if not TestCase_RunProces.is_init:
         init_db()
         TestCase_RunProces.is_init = True
     self.pipeline = get_global_test_pipeline()
     self.pipe = self.pipeline.get_or_create_pipe('test_system', config=test_system_config)
     self.pipe.register_domain(_domainmodel)
     self.pipe.mappings = []
     self.pipe.mappings.extend(init_tabsource_to_sor_mappings())
Example #3
0
 def setUp(self):
     if not TestCase_DbFunctions.is_init:
         init_db()
         TestCase_DbFunctions.is_init = True
     self.pipeline = get_global_test_pipeline()
     self.pipe = self.pipeline.get_or_create_pipe('test_system')
     self.pipe.register_domain(_domainmodel)
     self.pipe.register_db_functions(_db_functions, self.pipe.sor)
     self.pipe.mappings = []
     self.pipe.mappings.extend(init_source_to_sor_mappings())
     self.pipe.mappings.extend(init_sor_to_dv_mappings(self.pipe.sor))
# #
# #
# #         # ###################################
# #         pipe.runid = 2
# #         pipe.run()
# #         # runid = 2
# #         # test_etl1_from_source_to_sor(runid)
# #         test_count(self, 'sor.patient_hstage', 9)
# #         test_count(self, 'sor.zorgtraject_hstage', 7)
# #         # test_etl2_from_sor_to_dv(runid)
# #         test_count(self, 'dv.patient_hub', 5)
# #         test_count(self, 'dv.zorgtraject_hub', 5)
# #         test_count(self, 'dv.patient_zorgtraject_link', 5)
# #
# #         # runid = 3
# #         # test_etl1_from_source_to_sor(runid)
# #         pipe.runid = 3
# #         pipe.run()
# #         test_count(self, 'sor.patient_hstage', 11)
# #         test_count(self, 'sor.zorgtraject_hstage', 9)
# #         # test_etl2_from_sor_to_dv(runid)
# #         test_count(self, 'dv.patient_hub', 7)
# #         test_count(self, 'dv.zorgtraject_hub', 6)
# #         test_count(self, 'dv.patient_zorgtraject_link', 6)
#


if __name__ == '__main__':
    init_db()
    unittest.main()