def setUp(self): self.pod = 'zte-pod1' self.project = 'functest' self.case = 'vPing' self.installer = 'fuel' self.version = 'C' self.build_tag = 'v3.0' self.scenario = 'odl-l2' self.criteria = 'passed' self.trust_indicator = result_models.TI(0.7) self.start_date = "2016-05-23 07:16:09.477097" self.stop_date = "2016-05-23 07:16:19.477097" self.update_date = "2016-05-24 07:16:19.477097" self.update_step = -0.05 super(TestResultBase, self).setUp() self.details = Details(timestart='0', duration='9s', status='OK') self.req_d = result_models.ResultCreateRequest( pod_name=self.pod, project_name=self.project, case_name=self.case, installer=self.installer, version=self.version, start_date=self.start_date, stop_date=self.stop_date, details=self.details.format(), build_tag=self.build_tag, scenario=self.scenario, criteria=self.criteria, trust_indicator=self.trust_indicator) self.get_res = result_models.TestResult self.list_res = result_models.TestResults self.update_res = result_models.TestResult self.basePath = '/api/v1/results' self.req_pod = pod_models.PodCreateRequest(self.pod, 'metal', 'zte pod 1') self.req_project = project_models.ProjectCreateRequest( self.project, 'vping test') self.req_testcase = testcase_models.TestcaseCreateRequest( self.case, '/cases/vping', 'vping-ssh test') self.create_help('/api/v1/pods', self.req_pod) self.create_help('/api/v1/projects', self.req_project) self.create_help('/api/v1/projects/%s/cases', self.req_testcase, self.project)
def setUp(self): super(TestResultBase, self).setUp() self.pod = self.pod_d.name self.project = 'functest' self.case = 'vPing' self.installer = 'fuel' self.version = 'C' self.build_tag = 'v3.0' self.scenario = 'odl-l2' self.criteria = 'passed' self.trust_indicator = result_models.TI(0.7) self.start_date = str(datetime.now()) self.stop_date = str(datetime.now() + timedelta(minutes=1)) self.update_date = str(datetime.now() + timedelta(days=1)) self.update_step = -0.05 self.details = Details(timestart='0', duration='9s', status='OK') self.req_d = result_models.ResultCreateRequest( pod_name=self.pod, project_name=self.project, case_name=self.case, installer=self.installer, version=self.version, start_date=self.start_date, stop_date=self.stop_date, details=self.details.format(), build_tag=self.build_tag, scenario=self.scenario, criteria=self.criteria, trust_indicator=self.trust_indicator) self.get_res = result_models.TestResult self.list_res = result_models.TestResults self.update_res = result_models.TestResult self.basePath = '/api/v1/results' self.req_project = project_models.ProjectCreateRequest( self.project, 'vping test') self.req_testcase = testcase_models.TestcaseCreateRequest( self.case, '/cases/vping', 'vping-ssh test') fake_pymongo.pods.insert(self.pod_d.format()) self.create_help('/api/v1/projects', self.req_project) self.create_help('/api/v1/projects/%s/cases', self.req_testcase, self.project)