Пример #1
0
 def test_experimentgroup_GET_one(self):
     self.req.swagger_data = {'appid': 1, 'expgroupid': 1, 'expid': 1}
     httpExperiments = Experiments(self.req)
     response = httpExperiments.experimentgroup_GET_one()
     experimentgroup = {
         'id':
         1,
         'name':
         'Group A',
         'experiment_id':
         1,
         'configurations': [{
             'experimentgroup_id': 1,
             'key': 'v1',
             'id': 1,
             'value': 0.5
         }, {
             'experimentgroup_id': 1,
             'key': 'v2',
             'id': 2,
             'value': True
         }],
         'dataitems': [{
             'id': 1,
             'client_id': 1,
             'key': 'key1',
             'value': 10,
             'startDatetime': '2016-01-01 00:00:00',
             'endDatetime': '2016-01-01 01:01:01',
             'client': {
                 'id': 1,
                 'clientname': 'First client'
             }
         }, {
             'id': 2,
             'client_id': 1,
             'key': 'key2',
             'value': 0.5,
             'startDatetime': '2016-02-02 01:01:02',
             'endDatetime': '2016-02-02 02:02:02',
             'client': {
                 'id': 1,
                 'clientname': 'First client'
             }
         }],
         'clients': [{
             'id': 1,
             'clientname': 'First client'
         }]
     }
     assert response == experimentgroup
Пример #2
0
 def test_experimentgroup_GET_one_nonexistent_experiment(self):
     self.req.swagger_data = {'appid': 1, 'expgroupid': 1, 'expid': 2}
     httpExperiments = Experiments(self.req)
     response = httpExperiments.experimentgroup_GET_one()
     assert response.status_code == 400
     assert response.json == None