File: test_ipv6.py

package info (click to toggle)
rpyc 6.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,324 kB
  • sloc: python: 6,442; makefile: 122
file content (31 lines) | stat: -rw-r--r-- 936 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import rpyc
import unittest
from rpyc.utils.server import ThreadedServer
from rpyc import SlaveService


# travis: "Network is unreachable", https://travis-ci.org/tomerfiliba/rpyc/jobs/108231239#L450
@unittest.skip("requires IPv6")
class Test_IPv6(unittest.TestCase):
    def setUp(self):
        self.server = ThreadedServer(SlaveService, port=0, ipv6=True)
        self.server.logger.quiet = True
        self.thd = self.server._start_in_thread()

    def tearDown(self):
        self.server.close()
        self.thd.join()

    def test_ipv6_conenction(self):
        c = rpyc.classic.connect("::1", port=self.server.port, ipv6=True)
        print(repr(c))
        print(c.modules.sys)
        print(c.modules["xml.dom.minidom"].parseString("<a/>"))
        c.execute("x = 5")
        self.assertEqual(c.namespace["x"], 5)
        self.assertEqual(c.eval("1+x"), 6)
        c.close()


if __name__ == "__main__":
    unittest.main()