Skip to content

Commit

Permalink
Tests for None values fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Nov 27, 2017
1 parent 3cc213e commit 11aac11
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions miio/tests/test_powerstrip.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,21 @@ def test_status(self):
assert self.state().load_power == self.device.start_state["power_consume_rate"]

def test_status_without_power_consume_rate(self):
del self.device.state["power_consume_rate"]
self.device._reset_state()

self.device.state["power_consume_rate"] = None
assert self.state().load_power is None

def test_status_without_current(self):
del self.device.state["current"]
self.device._reset_state()

self.device.state["current"] = None
assert self.state().current is None

def test_status_without_mode(self):
del self.device.state["mode"]
self.device._reset_state()

self.device.state["mode"] = None
assert self.state().mode is None

def test_set_power_mode(self):
Expand Down

0 comments on commit 11aac11

Please sign in to comment.