mirror of
https://github.com/platformio/platformio-core.git
synced 2025-10-04 09:30:55 +02:00
Refactor CMD:LIB tests
This commit is contained in:
@@ -23,13 +23,13 @@ def test_ping_internet_ips():
|
||||
requests.get("http://%s" % ip, allow_redirects=False, timeout=2)
|
||||
|
||||
|
||||
def test_api_internet_offline(monkeypatch, isolated_pio_home):
|
||||
monkeypatch.setattr(util, "_internet_on", lambda: False)
|
||||
def test_api_internet_offline(without_internet, isolated_pio_home):
|
||||
with pytest.raises(exception.InternetIsOffline):
|
||||
util.get_api_result("/stats")
|
||||
|
||||
|
||||
def test_api_cache(monkeypatch, isolated_pio_home):
|
||||
api_kwargs = {"url": "/stats", "cache_valid": "1m"}
|
||||
api_kwargs = {"url": "/stats", "cache_valid": "10s"}
|
||||
result = util.get_api_result(**api_kwargs)
|
||||
assert result and "boards" in result
|
||||
monkeypatch.setattr(util, '_internet_on', lambda: False)
|
||||
|
Reference in New Issue
Block a user