def test_invalid_server_call(self): with pytest.raises(Exception) as excinfo1: api.server_call(None, None) with pytest.raises(Exception) as excinfo2: api.server_call("GetVersion", None) assert "method" in str(excinfo1.value) assert "server" in str(excinfo2.value)
def test_invalid_server_call(self): with pytest.raises(Exception) as excinfo1: api.server_call(None, None) with pytest.raises(Exception) as excinfo2: api.server_call('GetVersion', None) assert 'method' in str(excinfo1.value) assert 'server' in str(excinfo2.value)
def test_timeout(self): with pytest.raises(TimeoutException) as excinfo: api.server_call("GetVersion", server="my36.geotab.com", timeout=0.01) assert "Request timed out @ my36.geotab.com" in str(excinfo.value)
def test_get_version(self): version = api.server_call("GetVersion", server="my3.geotab.com") version_split = version.split(".") assert len(version_split) == 4
def test_timeout(self): with pytest.raises(TimeoutException) as excinfo: api.server_call('GetVersion', server='my36.geotab.com', timeout=0.01) assert 'Request timed out @ my36.geotab.com' in str(excinfo.value)
def test_get_version(self): version = api.server_call('GetVersion', server='my3.geotab.com') version_split = version.split('.') assert len(version_split) == 4