コード例 #1
0
ファイル: test_integration.py プロジェクト: springstar/twotp
    def test_callRemote(self):
        """
        L{Process.callRemote} executes the given function on the remove process
        and returns the reponse.
        """
        process = Process(self.nodeName, self.cookie)

        def check(response):
            expected = (Atom("ok"), map(ord, os.getcwd()))
            self.assertEqual(response, expected)

        return process.callRemote(
            self.erlangName, "file", "get_cwd").addCallback(check)
コード例 #2
0
ファイル: test_integration.py プロジェクト: springstar/twotp
    def test_setCompatibility(self):
        """
        Sets created by twotp are compatible with erlang sets.
        """
        s = set([Atom("foo"), 3])
        process = Process(self.nodeName, self.cookie)

        def check(response):
            expected = set([Atom("foo"), 3, Atom("egg")])
            self.assertEqual(response, expected)

        deferred = process.callRemote(
            self.erlangName, "sets", "add_element", Atom("egg"), s)
        return deferred.addCallback(check)
コード例 #3
0
ファイル: test_integration.py プロジェクト: springstar/twotp
    def test_dictCompatibility(self):
        """
        Dicts created by twotp are compatible with erlang dict.
        """
        d = {Atom("foo"): "spam"}
        process = Process(self.nodeName, self.cookie)

        def check(response):
            expected = {Atom("egg"): 4, Atom("foo"): map(ord, "spam")}
            self.assertEqual(response, expected)

        deferred = process.callRemote(
            self.erlangName, "dict", "store", Atom("egg"), 4, d)
        return deferred.addCallback(check)