Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpmbuild: cleanup el6 code #3396

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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