aboutsummaryrefslogtreecommitdiff
path: root/tests/test_ctl_client.py
blob: 9b787c0a5dd6c9bdb69bb7afeedcd0b9d5c9b498 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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)