summaryrefslogtreecommitdiff
path: root/test/test_send_fake_sound_hit.py
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-06-14 02:44:43 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-06-14 22:56:46 +0300
commite3d3d6b76010a6dd5c417f017339bec17fb07887 (patch)
tree42cb6194504ae863db2bf7d21ef9e2acd41d0fd2 /test/test_send_fake_sound_hit.py
parent600fdf99ffd893857c9cdb9e68140766a963bd17 (diff)
media: refactor sound_node, introduce camera_node
Diffstat (limited to 'test/test_send_fake_sound_hit.py')
-rwxr-xr-xtest/test_send_fake_sound_hit.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/test_send_fake_sound_hit.py b/test/test_send_fake_sound_hit.py
new file mode 100755
index 0000000..9660c45
--- /dev/null
+++ b/test/test_send_fake_sound_hit.py
@@ -0,0 +1,25 @@
+#!/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__)), '..')
+ )
+])
+
+from argparse import ArgumentParser
+from src.home.util import send_datagram, stringify, parse_addr
+
+
+if __name__ == '__main__':
+ parser = ArgumentParser()
+ parser.add_argument('--name', type=str, required=True,
+ help='node name, like `diana`')
+ parser.add_argument('--hits', type=int, required=True,
+ help='hits count')
+ parser.add_argument('--server', type=str, required=True,
+ help='center server addr in host:port format')
+
+ args = parser.parse_args()
+
+ send_datagram(stringify([args.name, args.hits]), parse_addr(args.server))