Skip to content

Commit

Permalink
Add encoding paremeter for open function
Browse files Browse the repository at this point in the history
  • Loading branch information
bieniu committed Aug 27, 2021
1 parent 52a1ab3 commit 6546efb
Showing 1 changed file with 43 additions and 43 deletions.
86 changes: 43 additions & 43 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@
@pytest.mark.asyncio
async def test_valid_data_first_value(): # pylint:disable=too-many-statements
"""Test with valid data and valid first sensor's value."""
with open("tests/fixtures/stations.json") as file:
with open("tests/fixtures/stations.json", encoding="utf-8") as file:
stations = json.load(file)
with open("tests/fixtures/station.json") as file:
with open("tests/fixtures/station.json", encoding="utf-8") as file:
station = json.load(file)
with open("tests/fixtures/sensor_658.json") as file:
with open("tests/fixtures/sensor_658.json", encoding="utf-8") as file:
sensor_658 = json.load(file)
with open("tests/fixtures/sensor_660.json") as file:
with open("tests/fixtures/sensor_660.json", encoding="utf-8") as file:
sensor_660 = json.load(file)
with open("tests/fixtures/sensor_665.json") as file:
with open("tests/fixtures/sensor_665.json", encoding="utf-8") as file:
sensor_665 = json.load(file)
with open("tests/fixtures/sensor_667.json") as file:
with open("tests/fixtures/sensor_667.json", encoding="utf-8") as file:
sensor_667 = json.load(file)
with open("tests/fixtures/sensor_670.json") as file:
with open("tests/fixtures/sensor_670.json", encoding="utf-8") as file:
sensor_670 = json.load(file)
with open("tests/fixtures/sensor_672.json") as file:
with open("tests/fixtures/sensor_672.json", encoding="utf-8") as file:
sensor_672 = json.load(file)
with open("tests/fixtures/sensor_14395.json") as file:
with open("tests/fixtures/sensor_14395.json", encoding="utf-8") as file:
sensor_14395 = json.load(file)
with open("tests/fixtures/indexes.json") as file:
with open("tests/fixtures/indexes.json", encoding="utf-8") as file:
indexes = json.load(file)

session = aiohttp.ClientSession()
Expand Down Expand Up @@ -131,25 +131,25 @@ async def test_api_error():
@pytest.mark.asyncio
async def test_valid_data_second_value(): # pylint:disable=too-many-statements
"""Test with valid data and valid second sensor's value."""
with open("tests/fixtures/stations.json") as file:
with open("tests/fixtures/stations.json", encoding="utf-8") as file:
stations = json.load(file)
with open("tests/fixtures/station.json") as file:
with open("tests/fixtures/station.json", encoding="utf-8") as file:
station = json.load(file)
with open("tests/fixtures/sensor_658.json") as file:
with open("tests/fixtures/sensor_658.json", encoding="utf-8") as file:
sensor_658 = json.load(file)
with open("tests/fixtures/sensor_660.json") as file:
with open("tests/fixtures/sensor_660.json", encoding="utf-8") as file:
sensor_660 = json.load(file)
with open("tests/fixtures/sensor_665.json") as file:
with open("tests/fixtures/sensor_665.json", encoding="utf-8") as file:
sensor_665 = json.load(file)
with open("tests/fixtures/sensor_667.json") as file:
with open("tests/fixtures/sensor_667.json", encoding="utf-8") as file:
sensor_667 = json.load(file)
with open("tests/fixtures/sensor_670.json") as file:
with open("tests/fixtures/sensor_670.json", encoding="utf-8") as file:
sensor_670 = json.load(file)
with open("tests/fixtures/sensor_672.json") as file:
with open("tests/fixtures/sensor_672.json", encoding="utf-8") as file:
sensor_672 = json.load(file)
with open("tests/fixtures/sensor_14395.json") as file:
with open("tests/fixtures/sensor_14395.json", encoding="utf-8") as file:
sensor_14395 = json.load(file)
with open("tests/fixtures/indexes.json") as file:
with open("tests/fixtures/indexes.json", encoding="utf-8") as file:
indexes = json.load(file)

sensor_658["values"][0]["value"] = None
Expand Down Expand Up @@ -233,23 +233,23 @@ async def test_valid_data_second_value(): # pylint:disable=too-many-statements
@pytest.mark.asyncio
async def test_no_indexes_data(): # pylint: disable=too-many-statements
"""Test with valid data."""
with open("tests/fixtures/stations.json") as file:
with open("tests/fixtures/stations.json", encoding="utf-8") as file:
stations = json.load(file)
with open("tests/fixtures/station.json") as file:
with open("tests/fixtures/station.json", encoding="utf-8") as file:
station = json.load(file)
with open("tests/fixtures/sensor_658.json") as file:
with open("tests/fixtures/sensor_658.json", encoding="utf-8") as file:
sensor_658 = json.load(file)
with open("tests/fixtures/sensor_660.json") as file:
with open("tests/fixtures/sensor_660.json", encoding="utf-8") as file:
sensor_660 = json.load(file)
with open("tests/fixtures/sensor_665.json") as file:
with open("tests/fixtures/sensor_665.json", encoding="utf-8") as file:
sensor_665 = json.load(file)
with open("tests/fixtures/sensor_667.json") as file:
with open("tests/fixtures/sensor_667.json", encoding="utf-8") as file:
sensor_667 = json.load(file)
with open("tests/fixtures/sensor_670.json") as file:
with open("tests/fixtures/sensor_670.json", encoding="utf-8") as file:
sensor_670 = json.load(file)
with open("tests/fixtures/sensor_672.json") as file:
with open("tests/fixtures/sensor_672.json", encoding="utf-8") as file:
sensor_672 = json.load(file)
with open("tests/fixtures/sensor_14395.json") as file:
with open("tests/fixtures/sensor_14395.json", encoding="utf-8") as file:
sensor_14395 = json.load(file)

session = aiohttp.ClientSession()
Expand Down Expand Up @@ -325,25 +325,25 @@ async def test_no_indexes_data(): # pylint: disable=too-many-statements
@pytest.mark.asyncio
async def test_no_sensor_data_1(): # pylint:disable=too-many-statements
"""Test with no sensor data."""
with open("tests/fixtures/stations.json") as file:
with open("tests/fixtures/stations.json", encoding="utf-8") as file:
stations = json.load(file)
with open("tests/fixtures/station.json") as file:
with open("tests/fixtures/station.json", encoding="utf-8") as file:
station = json.load(file)
with open("tests/fixtures/sensor_658.json") as file:
with open("tests/fixtures/sensor_658.json", encoding="utf-8") as file:
sensor_658 = json.load(file)
with open("tests/fixtures/sensor_660.json") as file:
with open("tests/fixtures/sensor_660.json", encoding="utf-8") as file:
sensor_660 = json.load(file)
with open("tests/fixtures/sensor_665.json") as file:
with open("tests/fixtures/sensor_665.json", encoding="utf-8") as file:
sensor_665 = json.load(file)
with open("tests/fixtures/sensor_667.json") as file:
with open("tests/fixtures/sensor_667.json", encoding="utf-8") as file:
sensor_667 = json.load(file)
with open("tests/fixtures/sensor_670.json") as file:
with open("tests/fixtures/sensor_670.json", encoding="utf-8") as file:
sensor_670 = json.load(file)
with open("tests/fixtures/sensor_672.json") as file:
with open("tests/fixtures/sensor_672.json", encoding="utf-8") as file:
sensor_672 = json.load(file)
with open("tests/fixtures/sensor_14395.json") as file:
with open("tests/fixtures/sensor_14395.json", encoding="utf-8") as file:
sensor_14395 = json.load(file)
with open("tests/fixtures/indexes.json") as file:
with open("tests/fixtures/indexes.json", encoding="utf-8") as file:
indexes = json.load(file)

sensor_658["values"][0]["value"] = None
Expand Down Expand Up @@ -417,9 +417,9 @@ async def test_no_sensor_data_1(): # pylint:disable=too-many-statements
@pytest.mark.asyncio
async def test_invalid_sensor_data_2():
"""Test with invalid sensor data."""
with open("tests/fixtures/stations.json") as file:
with open("tests/fixtures/stations.json", encoding="utf-8") as file:
stations = json.load(file)
with open("tests/fixtures/station.json") as file:
with open("tests/fixtures/station.json", encoding="utf-8") as file:
station = json.load(file)

session = aiohttp.ClientSession()
Expand Down Expand Up @@ -474,7 +474,7 @@ async def test_invalid_sensor_data_2():
@pytest.mark.asyncio
async def test_no_station_data():
"""Test with no station data."""
with open("tests/fixtures/stations.json") as file:
with open("tests/fixtures/stations.json", encoding="utf-8") as file:
stations = json.load(file)

session = aiohttp.ClientSession()
Expand Down Expand Up @@ -519,7 +519,7 @@ async def test_no_stations_data():
@pytest.mark.asyncio
async def test_invalid_station_id():
"""Test with invalid station_id."""
with open("tests/fixtures/stations.json") as file:
with open("tests/fixtures/stations.json", encoding="utf-8") as file:
stations = json.load(file)

session = aiohttp.ClientSession()
Expand Down

0 comments on commit 6546efb

Please sign in to comment.