Skip to content

Commit

Permalink
Use str instead of float
Browse files Browse the repository at this point in the history
  • Loading branch information
escoand committed Aug 8, 2019
1 parent e126b4b commit 71603a7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/components/traccar/test_init.py
Expand Up @@ -78,7 +78,7 @@ async def webhook_id(hass, traccar_client):
async def test_missing_data(hass, traccar_client, webhook_id):
"""Test missing data."""
url = "/api/webhook/{}".format(webhook_id)
data = {"lat": 1.0, "lon": 1.1, "id": "123"}
data = {"lat": "1.0", "lon": "1.1", "id": "123"}

# No data
req = await traccar_client.post(url)
Expand All @@ -105,13 +105,13 @@ async def test_enter_and_exit(hass, traccar_client, webhook_id):
url = "/api/webhook/{}".format(webhook_id)
data = {
"timestamp": 123456789,
"lat": HOME_LATITUDE,
"lon": HOME_LONGITUDE,
"lat": str(HOME_LATITUDE),
"lon": str(HOME_LONGITUDE),
"id": "123",
"accuracy": 10.5,
"accuracy": "10.5",
"batt": 10,
"speed": 100,
"bearing": 105.32,
"bearing": "105.32",
"altitude": 102,
}

Expand Down Expand Up @@ -157,13 +157,13 @@ async def test_enter_with_attrs(hass, traccar_client, webhook_id):
url = "/api/webhook/{}".format(webhook_id)
data = {
"timestamp": 123456789,
"lat": 1.0,
"lon": 1.1,
"lat": "1.0",
"lon": "1.1",
"id": "123",
"accuracy": 10.5,
"accuracy": "10.5",
"batt": 10,
"speed": 100,
"bearing": 105.32,
"bearing": "105.32",
"altitude": 102,
}

Expand Down Expand Up @@ -207,7 +207,7 @@ async def test_enter_with_attrs(hass, traccar_client, webhook_id):
async def test_load_unload_entry(hass, traccar_client, webhook_id):
"""Test that the appropriate dispatch signals are added and removed."""
url = "/api/webhook/{}".format(webhook_id)
data = {"lat": HOME_LATITUDE, "lon": HOME_LONGITUDE, "id": "123"}
data = {"lat": str(HOME_LATITUDE), "lon": str(HOME_LONGITUDE), "id": "123"}

# Enter the Home
req = await traccar_client.post(url, params=data)
Expand Down

0 comments on commit 71603a7

Please sign in to comment.