Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

Tests requiring internet #403

Open
jayvdb opened this issue Mar 28, 2019 · 0 comments
Open

Tests requiring internet #403

jayvdb opened this issue Mar 28, 2019 · 0 comments

Comments

@jayvdb
Copy link

jayvdb commented Mar 28, 2019

It looks like the tests are supposed to work without internet, but I found three which didn't in master.

My patch to solve it was

commit 5525bd1607ed4af5db7e31c89357a54a8b222728
Author: John Vandenberg <[email protected]>
Date:   Thu Mar 28 19:13:55 2019 +0700

    Mark internet tests

diff --git a/test/test_http11.py b/test/test_http11.py
index 9f3fd3d..12e4360 100644
--- a/test/test_http11.py
+++ b/test/test_http11.py
@@ -544,6 +544,7 @@ class TestHTTP11Connection(object):
 
         assert received == expected
 
+    @pytest.mark.rpmfail_getaddrinfo
     def test_exception_raised_for_illegal_body_type(self):
         c = HTTP11Connection('httpbin.org')
 
@@ -561,6 +562,7 @@ class TestHTTP11Connection(object):
                'returning bytestrings or an iterable of bytestrings. ' \
                'Got: {}'.format(type(body)) in str(exc_info)
 
+    @pytest.mark.rpmfail_getaddrinfo
     def test_exception_raised_for_illegal_elements_in_iterable_body(self):
         c = HTTP11Connection('httpbin.org')
 
@@ -580,6 +582,7 @@ class TestHTTP11Connection(object):
                'element: {}'.format(rogue_element) \
                in str(exc_info)
 
+    @pytest.mark.rpmfail_getaddrinfo
     def test_exception_raised_for_filelike_body_not_returning_bytes(self):
         c = HTTP11Connection('httpbin.org')
 

If they should be working without internet, I've made a mistake somewhere in packaging/testing.

If they do need internet, I'd be happy to submit the above patch so that it is easy for packagers to omit them.

Full rpm spec and patches at https://build.opensuse.org/request/show/689345

Note that #402 was needed in development and master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant