Пример #1
0
def call(msg='', channel=''):
    shared = ProtoShared()
    api = client_api.Client()
    cmd = api.send_ping(msg=msg, channel=channel, pingId='PING')

    print('Response: %s' % shared.pingName(cmd.ping.pingId))
    print('message sent: %s' % cmd.ping.msg)
    print('to channel: %s' % cmd.ping.channel)
Пример #2
0
def call(msg='', channel=''):
    shared = ProtoShared()
    api = client_api.Client()
    cmd = api.send_ping(
        msg=msg,
        channel=channel,
        pingId='PING'
        )

    print('Response: %s' % shared.pingName(cmd.ping.pingId))
    print('message sent: %s' % cmd.ping.msg)
    print('to channel: %s' % cmd.ping.channel)
Пример #3
0
class TestClient(unittest.TestCase):
    @classmethod
    def setUpClass(self):
        self.shared = ProtoShared()
        self.api = client_api.Client()

    def test_ping(self):
        msg = 'hello'
        channel = 'foo'
        cmd = self.api.send_ping(msg=msg, channel=channel, pingId='PING')
        self.assertEqual(cmd.ping.pingId, self.shared.pingValue('PONG'))
        self.assertEqual(cmd.ping.msg, msg)
        self.assertEqual(cmd.ping.channel, channel)
Пример #4
0
class TestClient(unittest.TestCase):

    @classmethod
    def setUpClass(self):
        self.shared = ProtoShared()
        self.api = client_api.Client()

    def test_ping(self):
        msg = 'hello'
        channel = 'foo'
        cmd = self.api.send_ping(
            msg=msg,
            channel=channel,
            pingId='PING'
            )
        self.assertEqual(cmd.ping.pingId, self.shared.pingValue('PONG'))
        self.assertEqual(cmd.ping.msg, msg)
        self.assertEqual(cmd.ping.channel, channel)
Пример #5
0
 def setUpClass(self):
     self.shared = ProtoShared()
     self.api = client_api.Client()
Пример #6
0
 def setUpClass(self):
     self.shared = ProtoShared()
     self.api = client_api.Client()