From 7eb1443a5aa5fbb39d43560ebc20c67d928b6cf6 Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Sat, 24 Mar 2018 09:40:46 +0100 Subject: [PATCH] Test the device class via the deprecation layer --- miio/tests/test_chuangmi_plug.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/miio/tests/test_chuangmi_plug.py b/miio/tests/test_chuangmi_plug.py index b042b457e..bbe45b918 100644 --- a/miio/tests/test_chuangmi_plug.py +++ b/miio/tests/test_chuangmi_plug.py @@ -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, @@ -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, @@ -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,