Example #1
0
    async def test_http_mpublish(self):

        http_writer = NsqdHttpWriter("127.0.0.1", 4151, loop=self.loop)
        messages = ["baz:1", b"baz:2", 3.14, 42]
        ok = await http_writer.mpub("http_baz", *messages)
        self.assertEqual(ok, "OK")
Example #2
0
    async def test_http_publish(self):

        http_writer = NsqdHttpWriter("127.0.0.1", 4151, loop=self.loop)
        ok = await http_writer.pub("http_baz", "producer msg")
        self.assertEqual(ok, "OK")
Example #3
0
 async def test_ok(self):
     conn = NsqdHttpWriter("127.0.0.1", 4151, loop=self.loop)
     res = await conn.ping()
     self.assertEqual(res, "OK")
Example #4
0
 async def test_create_channel(self):
     conn = NsqdHttpWriter("127.0.0.1", 4151, loop=self.loop)
     res = await conn.create_topic("zap")
     self.assertEqual("", res)
     res = await conn.create_channel("zap", "bar")
     self.assertEqual("", res)
Example #5
0
 async def test_delete_topic(self):
     conn = NsqdHttpWriter("127.0.0.1", 4151, loop=self.loop)
     res = await conn.delete_topic("foo2")
     self.assertEqual("", res)
Example #6
0
 async def test_mpub(self):
     conn = NsqdHttpWriter("127.0.0.1", 4151, loop=self.loop)
     res = await conn.mpub("baz", "baz_msg:1", "baz_msg:1")
     self.assertEqual("OK", res)
Example #7
0
 async def test_stats(self):
     conn = NsqdHttpWriter("127.0.0.1", 4151, loop=self.loop)
     res = await conn.stats()
     self.assertIn("version", res)