Skip to content

Commit

Permalink
Clean up some of the ozw tests (home-assistant#41578)
Browse files Browse the repository at this point in the history
* Remove some unnecessary fixtures and combine csv dumps
  • Loading branch information
firstof9 authored Oct 10, 2020
1 parent 025bdd7 commit de300dd
Show file tree
Hide file tree
Showing 5 changed files with 177 additions and 189 deletions.
12 changes: 0 additions & 12 deletions tests/components/ozw/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@ def light_new_ozw_data_fixture():
return load_fixture("ozw/light_new_ozw_network_dump.csv")


@pytest.fixture(name="light_pure_rgb_dimmer_data", scope="session")
def light_pure_rgb_dimmer_data_fixture():
"""Load light rgb and dimmer MQTT data and return it."""
return load_fixture("ozw/light_pure_rgb_dimmer_dump.csv")


@pytest.fixture(name="light_no_rgb_data", scope="session")
def light_no_rgb_data_fixture():
"""Load light dimmer MQTT data and return it."""
return load_fixture("ozw/light_no_rgb_network_dump.csv")


@pytest.fixture(name="light_no_ww_data", scope="session")
def light_no_ww_data_fixture():
"""Load light dimmer MQTT data and return it."""
Expand Down
8 changes: 4 additions & 4 deletions tests/components/ozw/test_light.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,10 @@ async def test_light(hass, light_data, light_msg, light_rgb_msg, sent_messages):


async def test_pure_rgb_dimmer_light(
hass, light_pure_rgb_dimmer_data, light_msg, light_pure_rgb_msg, sent_messages
hass, light_data, light_pure_rgb_msg, sent_messages
):
"""Test light with no color channels command class."""
receive_message = await setup_ozw(hass, fixture=light_pure_rgb_dimmer_data)
receive_message = await setup_ozw(hass, fixture=light_data)

# Test loaded
state = hass.states.get("light.kitchen_rgb_strip_level")
Expand Down Expand Up @@ -392,9 +392,9 @@ async def test_pure_rgb_dimmer_light(
assert state.attributes["hs_color"] == (300.0, 70.196)


async def test_no_rgb_light(hass, light_no_rgb_data, light_no_rgb_msg, sent_messages):
async def test_no_rgb_light(hass, light_data, light_no_rgb_msg, sent_messages):
"""Test setting up config entry."""
receive_message = await setup_ozw(hass, fixture=light_no_rgb_data)
receive_message = await setup_ozw(hass, fixture=light_data)

# Test loaded no RGBW support (dimmer only)
state = hass.states.get("light.master_bedroom_l_level")
Expand Down
174 changes: 173 additions & 1 deletion tests/fixtures/ozw/light_network_dump.csv

Large diffs are not rendered by default.

41 changes: 0 additions & 41 deletions tests/fixtures/ozw/light_no_rgb_network_dump.csv

This file was deleted.

131 changes: 0 additions & 131 deletions tests/fixtures/ozw/light_pure_rgb_dimmer_dump.csv

This file was deleted.

0 comments on commit de300dd

Please sign in to comment.