Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
DomAmato committed Jul 15, 2020
1 parent d82713a commit 445468c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tests/Cloud/test_CustomCloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@
def mock_scan(network):
return ['MockModem']

def mock_disconnect(network):
return True

@pytest.fixture
def no_modem(monkeypatch):
monkeypatch.setattr(Network, '_scan_for_modems', mock_scan)
monkeypatch.setattr(Network, '_modemHandlers', {'MockModem': MockModem})
monkeypatch.setattr(Network, 'disconnect', mock_disconnect)


def test_create_send(no_modem):
Expand Down
10 changes: 9 additions & 1 deletion tests/MockModem.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,12 @@ def __init__(self, device_name=None, baud_rate='9600',
self.last_read_payload_length = 0
self.result = ModemResult.OK
self.debug_out = ''
self.in_ext = False
self.in_ext = False
self._ppp = None

def is_connected(self):
return True

@property
def localIPAddress(self):
return "0.0.0.0"

0 comments on commit 445468c

Please sign in to comment.