FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-kasa/tests/test_device_type.py at patch · python-kasa/python-kasa · GitHub
python-kasa
python-kasa
Repository navigation
Code
Issues
56
(56)
Pull requests
43
(43)
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-kasa
/
tests
/
test_device_type.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (16 loc) · 872 Bytes
Breadcrumbs
python-kasa
/
tests
/
test_device_type.py
Copy path
File metadata and controls
23 lines (16 loc) · 872 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from
kasa
.
device_type
import
DeviceType
async
def
test_device_type_from_value
():
"""Make sure that every device type can be created from its value."""
for
name
in
DeviceType
:
assert
DeviceType
.
from_value
(
name
.
value
)
is
not
None
assert
DeviceType
.
from_value
(
"nonexistent"
)
is
DeviceType
.
Unknown
assert
DeviceType
.
from_value
(
"plug"
)
is
DeviceType
.
Plug
assert
DeviceType
.
Plug
.
value
==
"plug"
assert
DeviceType
.
from_value
(
"bulb"
)
is
DeviceType
.
Bulb
assert
DeviceType
.
Bulb
.
value
==
"bulb"
assert
DeviceType
.
from_value
(
"dimmer"
)
is
DeviceType
.
Dimmer
assert
DeviceType
.
Dimmer
.
value
==
"dimmer"
assert
DeviceType
.
from_value
(
"strip"
)
is
DeviceType
.
Strip
assert
DeviceType
.
Strip
.
value
==
"strip"
assert
DeviceType
.
from_value
(
"lightstrip"
)
is
DeviceType
.
LightStrip
assert
DeviceType
.
LightStrip
.
value
==
"lightstrip"
Back
|
FazBrowse Home
|
New Git URL