Remove unused test code
authorAlexander Cecile <redacted>
Fri, 28 Aug 2020 07:18:41 +0000 (03:18 -0400)
committerAlexander Cecile <redacted>
Fri, 28 Aug 2020 07:18:41 +0000 (03:18 -0400)
testUpdateHostsFile.py

index 3f09e2308d1a4d8deba20f35df76779a6cc4cb3b..7ca920280302649df9417fecb9b75fcef580c3ba 100644 (file)
@@ -1408,77 +1408,6 @@ class TestRemoveOldHostsFile(BaseMockDir):
 # End File Logic
 
 
-# Helper Functions
-def mock_url_open(url):
-    """
-    Mock of `urlopen` that returns the url in a `BytesIO` stream.
-
-    Parameters
-    ----------
-    url : str
-        The URL associated with the file to open.
-
-    Returns
-    -------
-    bytes_stream : BytesIO
-        The `url` input wrapped in a `BytesIO` stream.
-    """
-
-    return BytesIO(url)
-
-
-def mock_url_open_fail(_):
-    """
-    Mock of `urlopen` that fails with an Exception.
-    """
-
-    raise Exception()
-
-
-def mock_url_open_read_fail(_):
-    """
-    Mock of `urlopen` that returns an object that fails on `read`.
-
-    Returns
-    -------
-    file_mock : mock.Mock
-        A mock of a file object that fails when reading.
-    """
-
-    def fail_read():
-        raise Exception()
-
-    m = mock.Mock()
-
-    m.read = fail_read
-    return m
-
-
-def mock_url_open_decode_fail(_):
-    """
-    Mock of `urlopen` that returns an object that fails on during decoding
-    the output of `urlopen`.
-
-    Returns
-    -------
-    file_mock : mock.Mock
-        A mock of a file object that fails when decoding the output.
-    """
-
-    def fail_decode(_):
-        raise Exception()
-
-    def read():
-        s = mock.Mock()
-        s.decode = fail_decode
-
-        return s
-
-    m = mock.Mock()
-    m.read = read
-    return m
-
-
 class DomainToIDNA(Base):
     def __init__(self, *args, **kwargs):
         super(DomainToIDNA, self).__init__(*args, **kwargs)
git clone https://git.99rst.org/PROJECT