forked from pool/python-tldextract
- Run test suite
- Add tldextract-tests-offline.patch No internet connection on OBS build hosts; skip suffix list snapshot diff OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-tldextract?expand=0&rev=9
This commit is contained in:
committed by
Git OBS Bridge
parent
73a3d5784b
commit
064d729ce0
@@ -1,6 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Mar 10 19:57:13 UTC 2019 - Martin Herkt <9+suse@cirno.systems>
|
||||
|
||||
- Run test suite
|
||||
- Add tldextract-tests-offline.patch
|
||||
No internet connection on OBS build hosts; skip suffix list
|
||||
snapshot diff
|
||||
- Update to 2.2.1
|
||||
* Bugfixes
|
||||
- Ignore case on punycode prefix check
|
||||
|
@@ -26,6 +26,15 @@ Group: Development/Languages/Python
|
||||
Url: https://github.com/john-kurkowski/tldextract
|
||||
Source: https://files.pythonhosted.org/packages/source/t/tldextract/tldextract-%{version}.tar.gz
|
||||
Source1: %{name}-rpmlintrc
|
||||
# No internet connection on OBS build hosts; skip suffix list snapshot diff
|
||||
Patch: tldextract-tests-offline.patch
|
||||
### BEGIN test requirements
|
||||
BuildRequires: %{python_module pytest-mock}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module requests-file} >= 1.4
|
||||
BuildRequires: %{python_module requests} >= 2.1.0
|
||||
BuildRequires: %{python_module responses}
|
||||
### END test requirements
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
@@ -46,6 +55,7 @@ as well.
|
||||
|
||||
%prep
|
||||
%setup -q -n tldextract-%{version}
|
||||
%autopatch -p1
|
||||
|
||||
%build
|
||||
%python_build
|
||||
@@ -54,6 +64,10 @@ as well.
|
||||
%python_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%check
|
||||
%python_exec setup.py develop --user
|
||||
%python_exec -m pytest -v tests
|
||||
|
||||
%files %{python_files}
|
||||
%license LICENSE
|
||||
%doc README.md
|
||||
|
28
tldextract-tests-offline.patch
Normal file
28
tldextract-tests-offline.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
diff -ru tldextract-2.2.1.orig/tests/integration_test.py tldextract-2.2.1/tests/integration_test.py
|
||||
--- tldextract-2.2.1.orig/tests/integration_test.py 2016-04-04 04:11:18.000000000 +0200
|
||||
+++ tldextract-2.2.1/tests/integration_test.py 2019-03-10 21:25:34.201039604 +0100
|
||||
@@ -8,24 +8,6 @@
|
||||
|
||||
import tldextract
|
||||
|
||||
-
|
||||
-def test_log_snapshot_diff(mocker):
|
||||
- mocker.patch.object(logging.getLogger(), 'level', logging.DEBUG)
|
||||
- debug_mock = mocker.patch.object(logging.getLogger('tldextract'), 'debug')
|
||||
-
|
||||
- extractor = tldextract.TLDExtract()
|
||||
- try:
|
||||
- os.remove(extractor.cache_file)
|
||||
- except (IOError, OSError):
|
||||
- logging.warning(traceback.format_exc())
|
||||
-
|
||||
- extractor('ignore.com')
|
||||
-
|
||||
- assert debug_mock.call_count == 1
|
||||
- log_str = debug_mock.call_args[0][0]
|
||||
- assert log_str.startswith('computed TLD diff')
|
||||
-
|
||||
-
|
||||
def test_bad_kwargs():
|
||||
with pytest.raises(ValueError):
|
||||
tldextract.TLDExtract(
|
Reference in New Issue
Block a user