From 4b79ab6f80d3b2013b8b0e04c0f75437321340c4 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Feb 23 2018 00:56:52 +0000 Subject: Tests: check we don't create events for DOOMED composes Signed-off-by: Adam Williamson --- diff --git a/test_relvalconsumer.py b/test_relvalconsumer.py index a806a4b..189a86b 100644 --- a/test_relvalconsumer.py +++ b/test_relvalconsumer.py @@ -134,6 +134,7 @@ MODBETA1 = 'Fedora-Modular-27-20171108.2' MODBRANCHED4 = 'Fedora-Modular-27-20171125.n.0' MODFINAL1 = 'Fedora-Modular-27-20171126.1' + # we don't really want to run size_check @mock.patch('subprocess.call', autospec=True, return_value=0) # get_current_release requires a network trip @@ -157,6 +158,19 @@ class TestRelvalConsumerPreBranch: # this always needs mocking, as whatever the 'current' event ought # to be in our fake release series. @mock.patch('wikitcms.wiki.Wiki.current_event', wikitcms.event.ComposeEvent(None, '24', 'Final', '1.4')) + def test_rawhide1_doomed(self, fakesmtp, fakecreate, fakesubproc): + """We would otherwise create an event for this message - + that's the next test - but if the status is DOOMED, we should + not. + """ + CONSUMER.consume(_fakemsg(RAWHIDE1, status='DOOMED')) + assert fakecreate.call_count == 0 + assert fakesmtp.call_count == 0 + assert fakesubproc.call_count == 0 + + @mock.patch('fedfind.release.Pungi4Release.get_package_nvras', _fakegetsame) + @mock.patch('wikitcms.event.ComposeEvent.creation_date', '20160530') + @mock.patch('wikitcms.wiki.Wiki.current_event', wikitcms.event.ComposeEvent(None, '24', 'Final', '1.4')) def test_rawhide1(self, fakesmtp, fakecreate, fakesubproc): """Creating first Rawhide nightly for next release.""" CONSUMER.consume(_fakemsg(RAWHIDE1))