feat(cloud): add edge host enrollment
This commit is contained in:
@@ -27,6 +27,7 @@ def test_device_config_store_add_remove_list_and_get(tmp_path) -> None:
|
||||
"server_url": "http://127.0.0.1:4723",
|
||||
"udid": "abc123",
|
||||
},
|
||||
"cloud_device_id": None,
|
||||
}
|
||||
assert [config["device_id"] for config in store.list()] == ["iphone-1", "iphone-2"]
|
||||
|
||||
@@ -56,3 +57,29 @@ def test_device_config_store_unknown_device_remove_is_noop(tmp_path) -> None:
|
||||
store.remove("missing")
|
||||
|
||||
assert store.get("missing") is None
|
||||
|
||||
|
||||
def test_device_config_store_persists_cloud_mapping_without_losing_it_on_update(
|
||||
tmp_path,
|
||||
) -> None:
|
||||
store = DeviceConfigStore(tmp_path / "device_config.sqlite3")
|
||||
store.add(
|
||||
device_id="iphone-local",
|
||||
name="iPhone",
|
||||
driver_type="wda",
|
||||
connection_info={"udid": "abc"},
|
||||
)
|
||||
|
||||
assert store.set_cloud_device_id("iphone-local", "device-cloud-a") is True
|
||||
store.add(
|
||||
device_id="iphone-local",
|
||||
name="Renamed iPhone",
|
||||
driver_type="wda",
|
||||
connection_info={"udid": "abc", "wda_local_port": 8101},
|
||||
)
|
||||
|
||||
config = store.get("iphone-local")
|
||||
assert config is not None
|
||||
assert config["cloud_device_id"] == "device-cloud-a"
|
||||
assert config["name"] == "Renamed iPhone"
|
||||
assert store.set_cloud_device_id("missing", "device-cloud-b") is False
|
||||
|
||||
Reference in New Issue
Block a user