aboutsummaryrefslogtreecommitdiff
path: root/tests/test_ctl_client.py
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2019-07-07 12:45:06 +0200
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2019-07-07 12:45:06 +0200
commit1396f2ef54b71d4344e28329a4d874a73e2e8e12 (patch)
treedd330f0547dcff34a67154461ef6f2949381a7a6 /tests/test_ctl_client.py
parent820ac976e61c2d908a35a2cb2914dffc9822e095 (diff)
Split the ctl_client in its own file, using guacamole.
Diffstat (limited to 'tests/test_ctl_client.py')
-rw-r--r--tests/test_ctl_client.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_ctl_client.py b/tests/test_ctl_client.py
new file mode 100644
index 0000000..9b787c0
--- /dev/null
+++ b/tests/test_ctl_client.py
@@ -0,0 +1,23 @@
+import unittest
+
+from pyapd import ctl_client, config
+
+
+class TestCtlClient(unittest.TestCase):
+ def setUp(self):
+ self.config = config.Config('tests/data/test_config.yaml')
+
+ def test_cmd_ping(self):
+ ping = ctl_client.Ping()
+ cmd = ping.get_command()
+ self.assertEqual(cmd, {"command": "ping"})
+
+ def test_cmd_add_object(self):
+ obj = {
+ "id": "http://example.org/123456",
+ "type": "object",
+ }
+ add_object = ctl_client.AddObject()
+ cmd = add_object.get_command(obj)
+ self.assertEqual(cmd['command'], 'add_object')
+ self.assertEqual(cmd['obj'], obj)