generated from Coding-Cuddles/bootstrap-python-kata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_smart_home.py
39 lines (28 loc) · 1.01 KB
/
test_smart_home.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import pytest
from smart_home import SmartHomeController
@pytest.fixture
def controller():
return SmartHomeController()
def test_turn_on_all(controller):
assert controller.turn_on_all() == [
"Switchable light turned on",
"Switchable light turned on",
"Networkable light turned on",
"Dimmable light turned on at full brightness",
"Coffee maker turned on",
"AC turned on",
]
def test_turn_off_all(controller):
assert controller.turn_off_all() == [
"Switchable light turned off",
"Switchable light turned off",
"Networkable light turned off",
"Dimmable light turned off",
"Coffee maker turned off",
"AC turned off",
]
def test_dim_light(controller):
assert controller.dimmable_light.dim(50) == "Dimmable light dimmed to 50%"
def test_connect_light_to_network(controller):
assert controller.networkable_light.connect_to_network(
"Home Network") == "Networkable light connected to Home Network"