From 14b2b5372941f385f6cb73dd1d57dc879dbaeb01 Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Jun 13 2019 03:56:17 +0000 Subject: [PATCH 1/2] Use fullname for project name --- diff --git a/gateway.py b/gateway.py index 5e1c288..3ee88f4 100755 --- a/gateway.py +++ b/gateway.py @@ -111,7 +111,7 @@ class Service: Service.sendPayload("pull-request.new", dict(pullrequest=dict( branch='master', id=job, - project=dict(name=Service.project), + project=dict(fullname=Service.project), title="Trigger event"))) @app.route("/jobs") From 1ef91a73cde402fe7bc80a8dfdcab34765b1e05b Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Jun 13 2019 05:17:43 +0000 Subject: [PATCH 2/2] Add zuul.yaml CI configuration Depends-On: https://pagure.io/fedora-zuul-jobs/pull-request/1 --- diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 0000000..a40f5fe --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,10 @@ +--- +- project: + check: + jobs: + - tox-py35: + nodeset: fedora-latest-container + gate: + jobs: + - tox-py35: + nodeset: fedora-latest-container diff --git a/tests.py b/tests.py index e82ba88..a255564 100644 --- a/tests.py +++ b/tests.py @@ -13,6 +13,7 @@ # under the License. import unittest +import unittest.mock import gateway @@ -51,8 +52,8 @@ class GatewayTestCase(unittest.TestCase): resp = self.app.get('/gateway/objects/{}/{}'.format(ref[:2], ref[2:])) assert '200 OK' == resp.status - def test_add_jobs(self): - self.app.sendPayload = lambda x, y: None + @unittest.mock.patch("gateway.Service.sendPayload") + def test_add_jobs(self, monkeypatch): resp = self.app.post('/jobs/test', data='[]') assert '200 OK' == resp.status assert {"status": "pending", "conf": []} == resp.json