Skip to content

Commit

Permalink
rpmbuild: cleanup el6 code
Browse files Browse the repository at this point in the history
introduced in commit 7dfb269
  • Loading branch information
xsuchy authored and praiskup committed Sep 5, 2024
1 parent 1f5796c commit 5199b16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
2 changes: 0 additions & 2 deletions rpmbuild/copr-rpmbuild.spec
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ Source0: %name-%version.tar.gz
BuildRequires: %{python}-copr-common >= %copr_common_version
BuildRequires: %{python}-devel
BuildRequires: %{python}-distro
%if 0%{?rhel} == 0 || 0%{?rhel} != 6
BuildRequires: %{python}-httmock
%endif
BuildRequires: %{rpm_python}
BuildRequires: asciidoc
BuildRequires: dist-git-client
Expand Down
25 changes: 6 additions & 19 deletions rpmbuild/tests/test_spec.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
import configparser

import os
import distro
import pytest

try:
from httmock import urlmatch, HTTMock

@urlmatch(netloc=r'(.*\.)?example\.com$')
def example_com_match(url, request):
return 'some-content'

except:
pass

from httmock import urlmatch, HTTMock

from copr_rpmbuild.providers.spec import UrlProvider
from . import TestCase

@urlmatch(netloc=r'(.*\.)?example\.com$')
def example_com_match(url, request):
return 'some-content'


try:
from unittest import mock
builtins = 'builtins'
Expand Down Expand Up @@ -79,9 +72,6 @@ def auto_test_setup(self):
def auto_test_cleanup(self):
self.cleanup_basic_dirs()

@pytest.mark.skipif(distro.id() in ['rhel', 'centos'] and
distro.major_version() == '6',
reason='on httmock on rhel6')
def test_srpm_query_string(self):
with HTTMock(example_com_match):
provider = UrlProvider(self.json_1, self.config)
Expand All @@ -93,9 +83,6 @@ def test_srpm_query_string(self):
with open(file, 'r') as f:
assert f.read() == 'some-content'

@pytest.mark.skipif(distro.id() in ['rhel', 'centos'] and
distro.major_version() == '6',
reason='on httmock on rhel6')
def test_spec_query_string(self):
with HTTMock(example_com_match):
provider = UrlProvider(self.json_2, self.config)
Expand Down

0 comments on commit 5199b16

Please sign in to comment.