forked from imapex/IOTEventNotification
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesting.py
More file actions
27 lines (17 loc) · 700 Bytes
/
testing.py
File metadata and controls
27 lines (17 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import unittest
from alerts.spark import SparkRoomAlert
from sensors.weather import WeatherUndergroundSensor
class AlertTestCase(unittest.TestCase):
def test_create_spark_room_alert(self):
cfg = {}
obj = SparkRoomAlert(cfg)
self.assertIsInstance(obj, SparkRoomAlert)
class SensorTestCase(unittest.TestCase):
def test_create_weather_sensor(self):
obj = WeatherUndergroundSensor('foo')
self.assertIsInstance(obj, WeatherUndergroundSensor)
if __name__ == '__name__':
tests = unittest.TestSuite()
tests.addTest(unittest.makeSuite(AlertTestCase))
tests.addTest(unittest.makeSuite(SensorTestCase))
unittest.main(defaultTest='main')