Merge pull request #801 from nepoz/NetworkTestFix
Removed dependency on pytest-socket for the Network module's unit tests.
This commit is contained in:
commit
4d422ffc84
1 changed files with 3 additions and 2 deletions
|
@ -39,8 +39,9 @@ class TestNetworkUnit(TestCase):
|
||||||
def test_load_module(self):
|
def test_load_module(self):
|
||||||
__import__("modules.contrib.network")
|
__import__("modules.contrib.network")
|
||||||
|
|
||||||
@pytest.mark.allow_hosts(["127.0.0.1"])
|
@mock.patch("socket.create_connection")
|
||||||
def test_no_internet(self):
|
def test_no_internet(self, socket_mock):
|
||||||
|
socket_mock.side_effect = Exception()
|
||||||
module = build_module()
|
module = build_module()
|
||||||
assert module.widgets()[0].full_text() == "No connection"
|
assert module.widgets()[0].full_text() == "No connection"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue