Move fixtures part 1 (#58902)

This commit is contained in:
Paulus Schoutsen 2021-11-01 20:47:05 -07:00 committed by GitHub
parent 0a94badb72
commit 31153ac155
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
561 changed files with 188 additions and 991 deletions

View file

@ -0,0 +1,28 @@
{
"controller": {
"id": 1,
"user_id": 1,
"serial_number": "12345678",
"mac": "12345678",
"firmware_version": "V1SHTHF",
"name": "Melissa 12345678",
"type": "melissa",
"room_id": null,
"created": "2016-07-06 18:59:46",
"deleted_at": null,
"online": true,
"_relation": {
"command_log": {
"state": 1,
"mode": 2,
"temp": 16,
"fan": 1
}
}
},
"_links": {
"self": {
"href": "/v1/controllers/12345678"
}
}
}

View file

@ -0,0 +1,27 @@
{
"12345678": {
"user_id": 1,
"serial_number": "12345678",
"mac": "12345678",
"firmware_version": "V1SHTHF",
"name": "Melissa 12345678",
"type": "melissa",
"room_id": null,
"created": "2016-07-06 18:59:46",
"id": 1,
"online": true,
"brand_id": 1,
"controller_log": {
"temp": 27.4,
"created": "2018-01-08T21:01:14.281Z",
"raw_temperature": 28928,
"humidity": 18.7,
"raw_humidity": 12946
},
"_links": {
"self": {
"href": "/v1/controllers"
}
}
}
}

View file

@ -0,0 +1,8 @@
{
"12345678": {
"temp": 27.4,
"raw_temperature": 28928,
"humidity": 18.7,
"raw_humidity": 12946
}
}

View file

@ -25,13 +25,13 @@ def melissa_mock():
"""Use this to mock the melissa api."""
api = Mock()
api.async_fetch_devices = AsyncMock(
return_value=json.loads(load_fixture("melissa_fetch_devices.json"))
return_value=json.loads(load_fixture("fetch_devices.json", "melissa"))
)
api.async_status = AsyncMock(
return_value=json.loads(load_fixture("melissa_status.json"))
return_value=json.loads(load_fixture("status.json", "melissa"))
)
api.async_cur_settings = AsyncMock(
return_value=json.loads(load_fixture("melissa_cur_settings.json"))
return_value=json.loads(load_fixture("cur_settings.json", "melissa"))
)
api.async_send = AsyncMock(return_value=True)