1
# Copyright 2015 Canonical Ltd.
3
# This program is free software: you can redistribute it and/or modify it
4
# under the terms of the GNU Affero General Public License version 3, as
5
# published by the Free Software Foundation.
7
# This program is distributed in the hope that it will be useful, but
8
# WITHOUT ANY WARRANTY; without even the implied warranties of
9
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
10
# PURPOSE. See the GNU Affero General Public License for more details.
12
# You should have received a copy of the GNU Affero General Public License
13
# along with this program. If not, see <http://www.gnu.org/licenses/>.
18
from ucitests import assertions
21
from imagewatcher import trigger_process
22
from ci_utils.testing import fixtures
25
class TestPost(unittest.TestCase):
27
def test_trigger_simple(self):
28
queue = fixtures.FakeTaskQueue('that_queue')
29
trigger_process.post(queue, 111, 'ubuntu-core/devel', 'lp:fake')
30
assertions.assertLength(self, 1, queue.msgs)
31
self.assertEqual(dict(channel='ubuntu-core/devel', revision=111,
32
test_branch='lp:fake'),
35
def test_trigger_with_output(self):
36
queue = fixtures.FakeTaskQueue('that_queue')
37
trigger_process.post(queue, 111, 'ubuntu-core/devel', 'lp:fake',
39
assertions.assertLength(self, 1, queue.msgs)
40
self.assertEqual(dict(channel='ubuntu-core/devel', revision=111,
41
test_branch='lp:fake',
42
output_queue='this_queue'),