2018-11-18 15:40:10 +01:00
|
|
|
import asyncio
|
|
|
|
from aiohttp.test_utils import AioHTTPTestCase, unittest_run_loop
|
|
|
|
from core.craftbeerpi import CraftBeerPi
|
|
|
|
|
|
|
|
|
2018-11-18 23:09:17 +01:00
|
|
|
class KettleTestCase(AioHTTPTestCase):
|
2018-11-18 15:40:10 +01:00
|
|
|
|
|
|
|
|
|
|
|
async def get_application(self):
|
|
|
|
self.cbpi = CraftBeerPi()
|
|
|
|
self.cbpi.setup()
|
|
|
|
return self.cbpi.app
|
|
|
|
|
|
|
|
|
|
|
|
@unittest_run_loop
|
|
|
|
async def test_example(self):
|
2018-11-18 23:09:17 +01:00
|
|
|
assert await self.cbpi.kettle.toggle_automtic(1) is True
|
|
|
|
assert await self.cbpi.kettle.toggle_automtic(1) is True
|
|
|
|
assert await self.cbpi.kettle.toggle_automtic(99) is False
|