From 108538e51757fb302d26092fd0ee76df2ed6f4fe Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Jan 23 2018 12:52:24 +0000 Subject: Tests: drop all modular tests but one to verify we get no event We stopped doing modular events again, but I forgot to update the tests. Drop all the tests but one, which we now use to ensure we don't create an event when a modular compose happens. We can always restore this again if necessary. Signed-off-by: Adam Williamson --- diff --git a/test_relvalconsumer.py b/test_relvalconsumer.py index dac817c..a72712d 100644 --- a/test_relvalconsumer.py +++ b/test_relvalconsumer.py @@ -417,78 +417,9 @@ def test_atomic1(fakesmtp, fakecreate, fakecompexists): @mock.patch('fedfind.release.Pungi4Release.get_package_nvras', _fakegetdifferent) @mock.patch('wikitcms.wiki.Wiki.current_modular_event', wikitcms.event.NightlyEvent(None, '27', 'Branched', '20171001.n.0', modular=True)) def test_modular_branched1(fakesmtp, fakecreate): - """Now a Modular compose shows up! We should get an event.""" - CONSUMER.consume(_fakemsg(MODBRANCHED1)) - assert fakecreate.call_args[1]['check'] is True - -@mock.patch('wikitcms.event.ValidationEvent.create', autospec=True) -@mock.patch('smtplib.SMTP', autospec=True) -@mock.patch('fedfind.release.Pungi4Release.get_package_nvras', _fakegetdifferent) -@mock.patch('wikitcms.wiki.Wiki.current_modular_event', wikitcms.event.NightlyEvent(None, '27', 'Branched', '20171030.n.0', modular=True)) -def test_modular_branched2(fakesmtp, fakecreate): - """Another compose the next day shouldn't produce an event even - with different packages. - """ - CONSUMER.consume(_fakemsg(MODBRANCHED2)) - assert fakecreate.call_count == 0 - assert fakesmtp.call_count == 0 - -@mock.patch('wikitcms.event.ValidationEvent.create', autospec=True) -@mock.patch('smtplib.SMTP', autospec=True) -@mock.patch('fedfind.release.Pungi4Release.get_package_nvras', _fakegetsame) -@mock.patch('wikitcms.wiki.Wiki.current_modular_event', wikitcms.event.NightlyEvent(None, '27', 'Branched', '20171030.n.0', modular=True)) -def test_modular_branched3_same(fakesmtp, fakecreate): - """Another compose a few days later with same packages shouldn't - create an event... + """Now a Modular compose shows up! We should NOT get an event, + because we don't do events for modular composes any more. """ - CONSUMER.consume(_fakemsg(MODBRANCHED3)) + CONSUMER.consume(_fakemsg(MODBRANCHED1)) assert fakecreate.call_count == 0 assert fakesmtp.call_count == 0 - -@mock.patch('wikitcms.event.ValidationEvent.create', autospec=True) -@mock.patch('smtplib.SMTP', autospec=True) -@mock.patch('fedfind.release.Pungi4Release.get_package_nvras', _fakegetdifferent) -@mock.patch('wikitcms.wiki.Wiki.current_modular_event', wikitcms.event.NightlyEvent(None, '27', 'Branched', '20171030.n.0', modular=True)) -def test_modular_branched3_different(fakesmtp, fakecreate): - """...but with different packages it should.""" - CONSUMER.consume(_fakemsg(MODBRANCHED3)) - assert fakecreate.call_args[1]['check'] is True - -@mock.patch('fedfind.release.ModularProduction.label', 'Beta-1.1') -@mock.patch('wikitcms.event.ValidationEvent.create', autospec=True) -@mock.patch('smtplib.SMTP', autospec=True) -@mock.patch('fedfind.release.Pungi4Release.get_package_nvras', _fakegetsame) -@mock.patch('wikitcms.wiki.Wiki.current_modular_event', wikitcms.event.NightlyEvent(None, '27', 'Branched', '20171106.n.0', modular=True)) -def test_modular_beta1(fakesmtp, fakecreate): - """Now a Modular Beta compose appears; event should be created - even though it's only a couple of days later and packages are - the same. - """ - CONSUMER.consume(_fakemsg(MODBETA1)) - assert fakecreate.call_args[1]['check'] is True - -@mock.patch('fedfind.release.Compose.exists', return_value=True) -@mock.patch('wikitcms.event.ValidationEvent.create', autospec=True) -@mock.patch('smtplib.SMTP', autospec=True) -@mock.patch('fedfind.release.Pungi4Release.get_package_nvras', _fakegetsame) -@mock.patch('wikitcms.event.ComposeEvent.creation_date', '20171108') -@mock.patch('wikitcms.wiki.Wiki.current_modular_event', wikitcms.event.ComposeEvent(None, '27', 'Beta', '1.1', modular=True)) -def test_modular_branched4(fakesmtp, fakecreate, fakecompexists): - """A nightly more than 2 weeks after Beta creates an event, even - with the same packages. - """ - CONSUMER.consume(_fakemsg(MODBRANCHED4)) - assert fakecreate.call_args[1]['check'] is True - -@mock.patch('fedfind.release.ModularProduction.label', 'Final-1.1') -@mock.patch('wikitcms.event.ValidationEvent.create', autospec=True) -@mock.patch('smtplib.SMTP', autospec=True) -@mock.patch('fedfind.release.Pungi4Release.get_package_nvras', _fakegetsame) -@mock.patch('wikitcms.wiki.Wiki.current_modular_event', wikitcms.event.NightlyEvent(None, '27', 'Branched', '20171125.n.0', modular=True)) -def test_modular_final1(fakesmtp, fakecreate): - """Modular Final appears; event should be created. - """ - CONSUMER.consume(_fakemsg(MODFINAL1)) - assert fakecreate.call_args[1]['check'] is True - -# vim: set textwidth=120 ts=8 et sw=4: