def test_addVersion(self, scenario):
     add = models.ScenarioVersion(version='danube', projects=list())
     scenario['installers'][0]['versions'].append(add.format())
     update = models.ScenarioUpdateRequest(field='version',
                                           op='add',
                                           locate={'installer': 'apex'},
                                           term=add.format())
     return update, scenario
    def test_deleteInstaller(self, scenario):
        scenario['installers'] = filter(lambda f: f['installer'] != 'apex',
                                        scenario['installers'])

        update = models.ScenarioUpdateRequest(field='installer',
                                              op='delete',
                                              locate={'installer': 'apex'})
        return update, scenario
 def test_addInstaller(self, scenario):
     add = models.ScenarioInstaller(installer='daisy', versions=list())
     scenario['installers'].append(add.format())
     update = models.ScenarioUpdateRequest(field='installer',
                                           op='add',
                                           locate={},
                                           term=add.format())
     return update, scenario
 def test_renameScenario_noName(self, scenario):
     new_name = self.scenario_2
     scenario['name'] = new_name
     update_req = models.ScenarioUpdateRequest(field='name',
                                               op='update',
                                               locate={},
                                               term={})
     return update_req, scenario
 def test_renameScenario(self, scenario):
     new_name = 'nosdn-nofeature-noha'
     scenario['name'] = new_name
     update_req = models.ScenarioUpdateRequest(field='name',
                                               op='update',
                                               locate={},
                                               term={'name': new_name})
     return update_req, scenario
 def test_addProject(self, scenario):
     add = models.ScenarioProject(project='qtip').format()
     scenario['installers'][0]['versions'][0]['projects'].append(add)
     update = models.ScenarioUpdateRequest(field='project',
                                           op='add',
                                           locate={
                                               'installer': 'apex',
                                               'version': 'master'
                                           },
                                           term=add)
     return update, scenario
    def test_changeOwner(self, scenario):
        scenario['installers'][0]['versions'][0]['owner'] = 'lucy'

        update = models.ScenarioUpdateRequest(field='owner',
                                              op='update',
                                              locate={
                                                  'installer': 'apex',
                                                  'version': 'master'
                                              },
                                              term={'owner': 'lucy'})
        return update, scenario
    def test_deleteVersion(self, scenario):
        scenario['installers'][0]['versions'] = filter(
            lambda f: f['version'] != 'master',
            scenario['installers'][0]['versions'])

        update = models.ScenarioUpdateRequest(field='version',
                                              op='delete',
                                              locate={
                                                  'installer': 'apex',
                                                  'version': 'master'
                                              })
        return update, scenario
 def test_deleteCustoms(self, scenario):
     projects = scenario['installers'][0]['versions'][0]['projects']
     functest = filter(lambda f: f['project'] == 'functest', projects)[0]
     functest['customs'] = ['healthcheck']
     update = models.ScenarioUpdateRequest(field='customs',
                                           op='delete',
                                           locate={
                                               'installer': 'apex',
                                               'version': 'master',
                                               'project': 'functest'
                                           },
                                           term=['vping_ssh'])
     return update, scenario
 def test_addTi(self, scenario):
     add = models.ScenarioTI(date=str(datetime.now()), status='gold')
     projects = scenario['installers'][0]['versions'][0]['projects']
     functest = filter(lambda f: f['project'] == 'functest', projects)[0]
     functest['trust_indicators'].append(add.format())
     update = models.ScenarioUpdateRequest(field='trust_indicator',
                                           op='add',
                                           locate={
                                               'installer': 'apex',
                                               'version': 'master',
                                               'project': 'functest'
                                           },
                                           term=add.format())
     return update, scenario
 def test_addScore(self, scenario):
     add = models.ScenarioScore(date=str(datetime.now()), score='11/12')
     projects = scenario['installers'][0]['versions'][0]['projects']
     functest = filter(lambda f: f['project'] == 'functest', projects)[0]
     functest['scores'].append(add.format())
     update = models.ScenarioUpdateRequest(field='score',
                                           op='add',
                                           locate={
                                               'installer': 'apex',
                                               'version': 'master',
                                               'project': 'functest'
                                           },
                                           term=add.format())
     return update, scenario
示例#12
0
 def test_renameScenario_exist(self):
     new_name = self.req_d['name']
     update = models.ScenarioUpdateRequest(name=new_name)
     return update
示例#13
0
 def test_renameScenario(self):
     new_name = 'new_scenario_name'
     update = models.ScenarioUpdateRequest(name=new_name)
     self.req_d['name'] = new_name
     return update