summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_polaris_stuff.py21
-rwxr-xr-xtest/test_sound_server_api.py3
2 files changed, 23 insertions, 1 deletions
diff --git a/test/test_polaris_stuff.py b/test/test_polaris_stuff.py
new file mode 100755
index 0000000..f3c8e6a
--- /dev/null
+++ b/test/test_polaris_stuff.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+import sys
+import os.path
+sys.path.extend([
+ os.path.realpath(
+ os.path.join(os.path.dirname(os.path.join(__file__)), '..')
+ )
+])
+
+import src.polaris as polaris
+
+
+if __name__ == '__main__':
+ sc = [cl for cl in polaris.protocol.CmdIncomingMessage.__subclasses__()
+ if cl is not polaris.protocol.SimpleBooleanMessage]
+ sc.extend(polaris.protocol.SimpleBooleanMessage.__subclasses__())
+ for cl in sc:
+ # if cl == polaris.protocol.HandshakeMessage:
+ # print('skip')
+ # continue
+ print(cl.__name__, cl.TYPE) \ No newline at end of file
diff --git a/test/test_sound_server_api.py b/test/test_sound_server_api.py
index 1b4eb8b..e68c6f8 100755
--- a/test/test_sound_server_api.py
+++ b/test/test_sound_server_api.py
@@ -12,6 +12,7 @@ from time import sleep
from src.home.config import config
from src.home.api import WebAPIClient
from src.home.api.types import SoundSensorLocation
+from typing import List, Tuple
interrupted = False
@@ -33,7 +34,7 @@ class HitCounter:
with self.lock:
self.sensors[name] += hits
- def get_all(self) -> list[tuple[str, int]]:
+ def get_all(self) -> List[Tuple[str, int]]:
vals = []
with self.lock:
for name, hits in self.sensors.items():