Use enums for rest tests (#62197)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Robert Hillis 2021-12-19 12:01:33 -05:00 committed by GitHub
parent b869b680fb
commit 1bd904b5b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 36 deletions

View file

@ -6,7 +6,7 @@ import aiohttp
from homeassistant.components.rest import DOMAIN
import homeassistant.components.rest.switch as rest
from homeassistant.components.switch import DEVICE_CLASS_SWITCH, DOMAIN as SWITCH_DOMAIN
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN, SwitchDeviceClass
from homeassistant.const import (
CONF_HEADERS,
CONF_NAME,
@ -23,7 +23,7 @@ from tests.common import assert_setup_component
"""Tests for setting up the REST switch platform."""
NAME = "foo"
DEVICE_CLASS = DEVICE_CLASS_SWITCH
DEVICE_CLASS = SwitchDeviceClass.SWITCH
METHOD = "post"
RESOURCE = "http://localhost/"
STATE_RESOURCE = RESOURCE