From 499fd34d331956828a8ddf0332a198e26e829ee0 Mon Sep 17 00:00:00 2001 From: Martin Krizek Date: May 09 2016 07:06:59 +0000 Subject: Remove bodhi network unit tests Summary: The unit test was to ensure that bodhi client doesn't make a network request during initialization to figure out whether it should return a Bodhi1 or Bodhi2 instance. That used to be the case and it made our unit tests very slow. Now the library doesn't seem to do that anymore and they even removed requests module (which we mocked in that unit test) from their code. Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D847 --- diff --git a/libtaskotron.spec b/libtaskotron.spec index fbcbbd1..99a75d0 100644 --- a/libtaskotron.spec +++ b/libtaskotron.spec @@ -62,13 +62,13 @@ Requires: dnf >= 0.6.4 Requires: koji Requires: libtaskotron-core = %{version}-%{release} Requires: mash -Requires: python-fedora >= 0.5.5 +Requires: python-fedora >= 0.8.0 Requires: python-hawkey >= 0.4.13-1 Requires: python-munch >= 2.0.2 Requires: rpm-python BuildRequires: koji BuildRequires: mash -BuildRequires: python-fedora >= 0.5.5 +BuildRequires: python-fedora >= 0.8.0 BuildRequires: python-hawkey >= 0.4.13-1 BuildRequires: python-munch >= 2.0.2 diff --git a/requirements.txt b/requirements.txt index 46dac66..603214c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,7 +18,7 @@ mock == 1.0.1 paramiko == 1.15.1 pytest == 2.7.3 pytest-cov == 2.2.1 -python-fedora == 0.5.5 +python-fedora == 0.8.0 progressbar == 2.3 requests == 2.7.0 PyYAML == 3.11 diff --git a/testing/test_bodhi_utils.py b/testing/test_bodhi_utils.py index 40dba10..c215a1f 100644 --- a/testing/test_bodhi_utils.py +++ b/testing/test_bodhi_utils.py @@ -19,20 +19,6 @@ from libtaskotron import config class TestBodhiUtils(): '''Test generic functionality''' - def test_nonetwork_on_creation(self, monkeypatch): - '''It's important that our stuff not attempt to access the network - during init so that %check doesn't fail during package build. At one - point, BodhiClient did ping bodhi production during init, so let's make - sure that doesn't happen''' - - assert hasattr(fedora.client.bodhi, 'requests') - stub_requests = Dingus() - monkeypatch.setattr(fedora.client.bodhi, 'requests', stub_requests) - - bu = bodhi_utils.BodhiUtils() - assert bu.client is not None - assert len(stub_requests.calls()) == 0 - def test_staging_or_production(self, monkeypatch): '''Client should be correctly created when requested staging in config or not''' monkeypatch.setattr(config, '_config', None)