예제 #1
0
 def test_update_build(self, session):
     session.app.post_json('/api/builds/ceph/', params=self.data)
     data = self.data.copy()
     data['status'] = "completed"
     result = session.app.post_json('/api/builds/ceph/', params=data)
     assert result.status_int == 200
     build = Build.get(1)
     assert build.status == "completed"
예제 #2
0
파일: test_builds.py 프로젝트: ceph/shaman
 def test_update_build(self, session):
     session.app.post_json('/api/builds/ceph/', params=self.data)
     data = self.data.copy()
     data['status'] = "completed"
     result = session.app.post_json('/api/builds/ceph/', params=data)
     assert result.status_int == 200
     build = Build.get(1)
     assert build.status == "completed"
     assert build.completed
예제 #3
0
 def __init__(self, _id):
     self.project = Project.get(request.context['project_id'])
     self.build = Build.get(_id)
     if not self.project:
         # TODO: nice project not found error template
         abort(404, 'project not found')
     if not self.build:
         # TODO: nice project not found error template
         abort(404, 'build not found')
예제 #4
0
 def __init__(self, _id):
     self.project = Project.get(request.context['project_id'])
     self.build = Build.get(_id)
     if not self.project:
         # TODO: nice project not found error template
         abort(404, 'project not found')
     if not self.build:
         # TODO: nice project not found error template
         abort(404, 'build not found')
예제 #5
0
파일: test_builds.py 프로젝트: ceph/shaman
 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"
예제 #6
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"
예제 #7
0
파일: test_builds.py 프로젝트: ceph/shaman
 def test_create_a_build(self, session):
     result = session.app.post_json('/api/builds/ceph/', params=self.data)
     assert result.status_int == 200
     build = Build.get(1)
     assert build.ref == "master"
     assert build.project.name == "ceph"
     assert build.flavor == "default"
     assert build.sha1 == "sha1"
     assert build.url == "jenkins.ceph.com/build"
     assert build.log_url == "jenkins.ceph.com/build/console"
     assert build.extra["version"] == "10.2.2"
     assert not build.distro
예제 #8
0
 def test_create_a_build(self, session):
     result = session.app.post_json('/api/builds/ceph/', params=self.data)
     assert result.status_int == 200
     build = Build.get(1)
     assert build.ref == "master"
     assert build.project.name == "ceph"
     assert build.flavor == "default"
     assert build.sha1 == "sha1"
     assert build.url == "jenkins.ceph.com/build"
     assert build.log_url == "jenkins.ceph.com/build/console"
     assert build.extra["version"] == "10.2.2"
     assert not build.distro
예제 #9
0
파일: test_builds.py 프로젝트: ceph/shaman
 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
예제 #10
0
파일: test_builds.py 프로젝트: ceph/shaman
 def test_update_queued_build_is_completed(self, session):
     data = get_build_data(status='queued', url='jenkins.ceph.com/trigger')
     session.app.post_json('/api/builds/ceph/', params=data)
     data = get_build_data(status='completed')
     session.app.post_json('/api/builds/ceph/', params=data)
     assert Build.get(1).status == 'completed'
예제 #11
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/'
예제 #12
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"
예제 #13
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
예제 #14
0
파일: test_builds.py 프로젝트: ceph/shaman
 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"
예제 #15
0
 def test_update_queued_build_is_completed(self, session):
     data = get_build_data(status='queued', url='jenkins.ceph.com/trigger')
     session.app.post_json('/api/builds/ceph/', params=data)
     data = get_build_data(status='completed')
     result = session.app.post_json('/api/builds/ceph/', params=data)
     assert Build.get(1).status == 'completed'
예제 #16
0
파일: test_builds.py 프로젝트: ceph/shaman
 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/'
예제 #17
0
파일: test_builds.py 프로젝트: ceph/shaman
 def test_update_queued_build_is_completed(self, session):
     data = get_build_data(status="queued", url="jenkins.ceph.com/trigger")
     session.app.post_json("/api/builds/ceph/", params=data)
     data = get_build_data(status="completed")
     result = session.app.post_json("/api/builds/ceph/", params=data)
     assert Build.get(1).status == "completed"