示例#1
0
 def test_list_sha1s_by_id(self, session):
     project = Project(name='ceph')
     Build(build_id=1, project=project, ref='master', sha1='1234')
     Build(build_id=2, project=project, ref='master', sha1='1234')
     Build(build_id=100, project=project, ref='master', sha1='1234')
     commit()
     result = session.app.get('/builds/ceph/master/1234/')
     assert result.namespace['builds'][0].build_id == '100'
     assert result.namespace['builds'][1].build_id == '2'
     assert result.namespace['builds'][2].build_id == '1'
示例#2
0
 def test_update_changes_modified(self, session):
     build = Build(self.p, **self.data)
     initial_timestamp = build.modified.time()
     session.commit()
     build.distro = "centos"
     session.commit()
     assert initial_timestamp < build.modified.time()
示例#3
0
 def test_can_create(self, session):
     Build(self.p, **self.data)
     session.commit()
     b = Build.get(1)
     assert b.ref == "master"
     assert b.sha1 == "sha1"
     assert b.url == "jenkins.ceph.com/build"
     assert b.log_url == "jenkins.ceph.com/build/console"
     assert b.build_id == "250"
     assert b.status == "failed"
示例#4
0
 def test_up_to_project(self, session):
     build = Build(self.p, **self.data)
     session.commit()
     result = build.get_url('project')
     assert result == '/builds/ceph/'
示例#5
0
 def test_by_sha1(self, session):
     build = Build(self.p, **self.data)
     session.commit()
     result = build.get_url('sha1')
     assert result == '/builds/ceph/master/sha1/'
示例#6
0
 def test_default_gives_full_url(self, session):
     Build(self.p, **self.data)
     session.commit()
     result = Build.get(1).get_url()
     assert result == '/builds/ceph/master/sha1/default/1/'
示例#7
0
 def test_sets_modified(self, session):
     build = Build(self.p, **self.data)
     session.commit()
     assert build.modified.timetuple()
示例#8
0
 def test_can_create_with_extra(self, session):
     b = Build(self.p, **self.data)
     b.extra = dict(version="10.2.2")
     session.commit()
     build = Build.get(1)
     assert build.extra['version'] == "10.2.2"
示例#9
0
 def test_distro_version_can_be_null(self, session):
     Build(self.p, **self.data)
     session.commit()
     b = Build.get(1)
     assert not b.distro_version