Exemplo n.º 1
0
    def testShouldEchoNestedLst(self):
        test_lists = [
            types.CypherList([
                types.CypherInt(1),
                types.CypherInt(2),
                types.CypherInt(3),
                types.CypherInt(4)
            ]),
            types.CypherList([
                types.CypherString("a"),
                types.CypherString("b"),
                types.CypherString("c"),
                types.CypherString("˚C")
            ]),
            types.CypherList([types.CypherBool(True),
                              types.CypherBool(False)]),
            types.CypherList([
                types.CypherFloat(1.1),
                types.CypherFloat(2.2),
                types.CypherFloat(3.3),
                types.CypherFloat(4.4)
            ]),
            types.CypherList([types.CypherNull(None),
                              types.CypherNull(None)]),
            types.CypherList([
                types.CypherNull(None),
                types.CypherBool(True),
                types.CypherString("Hello world"),
                types.CypherInt(-1234567890),
                types.CypherFloat(1.7976931348623157E+308)
            ])
        ]

        self.createDriverAndSession()
        self.verifyCanEcho(test_lists, types.CypherList)
Exemplo n.º 2
0
    def testShouldEchoBack(self):
        if get_driver_name() in ['java']:
            self.skipTest("Not implemented in backend")

        vals = [
            types.CypherBool(True),
            types.CypherBool(False),
            types.CypherNull(),
            types.CypherInt(1),
            types.CypherInt(-7),
            types.CypherInt(-129),
            types.CypherInt(129),
            types.CypherInt(2147483647),
            types.CypherInt(-2147483647),
            #types.CypherFloat(9223372036854775807),       # TODO: Investigate
            #types.CypherFloat(-9223372036854775807),
            #types.CypherFloat(1.7976931348623157E+308),
            #types.CypherFloat(2.2250738585072014e-308),
            #types.CypherFloat(4.9E-324),
            #types.CypherFloat(0.0),  # Js can not determine if it should be 0 or 0.0
            types.CypherFloat(1.1),
            types.CypherString("1"),
            types.CypherString("-17∂ßå®"),
            types.CypherString("String"),
            types.CypherString(""),
        ]

        self.createDriverAndSession()
        for val in vals:
            self.verifyCanEcho(val)
Exemplo n.º 3
0
    def testShouldEchoNestedMap(self):
        if get_driver_name() not in ['dotnet', 'go']:
            self.skipTest("Not implemented in backend")

        test_maps = {
            "a":
            types.CypherMap({
                "a": types.CypherInt(1),
                "b": types.CypherInt(2),
                "c": types.CypherInt(3),
                "d": types.CypherInt(4)
            }),
            "b":
            types.CypherMap({
                "a": types.CypherBool(True),
                "b": types.CypherBool(False)
            }),
            "c":
            types.CypherMap({
                "a": types.CypherFloat(1.1),
                "b": types.CypherFloat(2.2),
                "c": types.CypherFloat(3.3)
            }),
            "d":
            types.CypherMap({
                "a": types.CypherString("a"),
                "b": types.CypherString("b"),
                "c": types.CypherString("c"),
                "temp": types.CypherString("˚C")
            }),
            "e":
            types.CypherMap({"a": types.CypherNull(None)}),
            "f":
            types.CypherMap({
                "a": types.CypherInt(1),
                "b": types.CypherBool(True),
                "c": types.CypherFloat(3.3),
                "d": types.CypherString("Hello World"),
                "e": types.CypherNull(None)
            }),
        }

        self.createDriverAndSession()
        self.verifyCanEcho(types.CypherMap(test_maps))
Exemplo n.º 4
0
    def testShouldEchoNestedLists(self):
        if get_driver_name() in ['java']:
            self.skipTest("Not implemented in backend")

        test_lists = [
            types.CypherList([
                types.CypherInt(1),
                types.CypherInt(2),
                types.CypherInt(3),
                types.CypherInt(4)
            ]),
            types.CypherList([
                types.CypherString("a"),
                types.CypherString("b"),
                types.CypherString("c"),
                types.CypherString("˚C")
            ]),
            types.CypherList([types.CypherBool(True),
                              types.CypherBool(False)]),
            types.CypherList([
                types.CypherFloat(1.1),
                types.CypherFloat(2.2),
                types.CypherFloat(3.3),
                types.CypherFloat(4.4)
            ]),
            types.CypherList([types.CypherNull(None),
                              types.CypherNull(None)]),
            types.CypherList([
                types.CypherNull(None),
                types.CypherBool(True),
                types.CypherString("Hello world"),
                types.CypherInt(-1234567890),
                types.CypherFloat(123.456)
            ])
        ]

        self.createDriverAndSession()
        self.verifyCanEcho(types.CypherList(test_lists))
Exemplo n.º 5
0
    def testShouldEchoVeryLongList(self):
        if get_driver_name() in ['java']:
            self.skipTest("Not implemented in backend")

        vals = [
            types.CypherNull(),
            types.CypherInt(1),
            types.CypherFloat(1.1),
            types.CypherString("hello"),
            types.CypherBool(True),
        ]

        self.createDriverAndSession()

        for val in vals:
            long_list = []
            for i in range(1000):
                long_list.append(val)
            self.verifyCanEcho(types.CypherList(long_list))
Exemplo n.º 6
0
    def testShouldEchoVeryLongMap(self):
        if get_driver_name() not in ['dotnet', 'go']:
            self.skipTest("Not implemented in backend")

        test_list = [
            types.CypherNull(None),
            types.CypherInt(1),
            types.CypherFloat(1.1),
            types.CypherString("Hello World"),
            types.CypherBool(True)
        ]

        self.createDriverAndSession()

        long_map = {}
        for cypherType in test_list:
            long_map.clear()
            for i in range(1000):
                long_map[str(i)] = cypherType
            self.verifyCanEcho(types.CypherMap(long_map))