Skip to content

Commit

Permalink
Test the device class via the deprecation layer
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Mar 24, 2018
1 parent f79b433 commit 7eb1443
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions miio/tests/test_chuangmi_plug.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
from unittest import TestCase
from miio import ChuangmiPlug
from miio.chuangmi_plug import (ChuangmiPlugStatus, MODEL_CHUANGMI_PLUG_V1,
MODEL_CHUANGMI_PLUG_V3, MODEL_CHUANGMI_PLUG_M1)
from miio.chuangmi_plug import (Plug, PlugV1, PlugV3, ChuangmiPlugStatus)
from .dummies import DummyDevice
import pytest


class DummyChuangmiPlugV1(DummyDevice, ChuangmiPlug):
class DummyChuangmiPlugV1(DummyDevice, PlugV1):
def __init__(self, *args, **kwargs):
self.model = MODEL_CHUANGMI_PLUG_V1
self.state = {
'on': True,
'usb_on': True,
Expand Down Expand Up @@ -82,9 +79,8 @@ def test_usb_off(self):
assert self.device.status().usb_power is False


class DummyChuangmiPlugV3(DummyDevice, ChuangmiPlug):
class DummyChuangmiPlugV3(DummyDevice, PlugV3):
def __init__(self, *args, **kwargs):
self.model = MODEL_CHUANGMI_PLUG_V3
self.state = {
'on': True,
'usb_on': True,
Expand Down Expand Up @@ -179,9 +175,8 @@ def wifi_led():
assert wifi_led() is False


class DummyChuangmiPlugM1(DummyDevice, ChuangmiPlug):
class DummyChuangmiPlugM1(DummyDevice, Plug):
def __init__(self, *args, **kwargs):
self.model = MODEL_CHUANGMI_PLUG_M1
self.state = {
'power': 'on',
'temperature': 32,
Expand Down

0 comments on commit 7eb1443

Please sign in to comment.