2022-08-17 14:17:11 +00:00
|
|
|
import os
|
|
|
|
from unittest import mock
|
|
|
|
|
|
|
|
from lightning_app.utilities.cloud import is_running_in_cloud
|
|
|
|
|
|
|
|
|
|
|
|
@mock.patch.dict(os.environ, clear=True)
|
|
|
|
def test_is_running_locally():
|
2022-08-30 00:33:21 +00:00
|
|
|
"""We can determine if Lightning is running locally."""
|
2022-08-17 14:17:11 +00:00
|
|
|
assert not is_running_in_cloud()
|
|
|
|
|
|
|
|
|
|
|
|
@mock.patch.dict(os.environ, {"LIGHTNING_APP_STATE_URL": "127.0.0.1"})
|
|
|
|
def test_is_running_cloud():
|
2022-08-30 00:33:21 +00:00
|
|
|
"""We can determine if Lightning is running in the cloud."""
|
2022-08-17 14:17:11 +00:00
|
|
|
assert is_running_in_cloud()
|