コード例 #1
0
ファイル: gremlin.py プロジェクト: windj007/gremlinpy
    def test_can_add_a_reserved_word_as_apart_of_the_query_as_function_without_args(self):
        g = Gremlin();
        unbound = ['arg', '2']
        init = UnboudFunction(g, '__init__', unbound)

        g.add_token(init)
        
        s        = str(g)
        params   = g.bound_params
        expected = 'g.__init__(%s, %s)' % (unbound[0], unbound[1])

        self.assertTrue(s == expected)
        self.assertTrue(len(params) == 0)
コード例 #2
0
ファイル: gremlin.py プロジェクト: windj007/gremlinpy
    def test_can_add_a_reserved_word_as_apart_of_the_query_as_function_with_args(self):
        g = Gremlin();
        init = Function(g, '__init__', ['arg'])

        g.add_token(init)
        
        s        = str(g)
        params   = g.bound_params
        arg      = get_dict_key(params, 'arg')
        expected = 'g.__init__(%s)' % arg
        
        self.assertTrue(s == expected)
        self.assertTrue(len(params) == 1)
コード例 #3
0
ファイル: gremlin.py プロジェクト: wintericie/gremlinpy
    def test_can_add_a_reserved_word_as_apart_of_the_query_as_function_without_args(
            self):
        g = Gremlin()
        unbound = ['arg', '2']
        init = UnboudFunction(g, '__init__', unbound)

        g.add_token(init)

        s = str(g)
        params = g.bound_params
        expected = 'g.__init__(%s, %s)' % (unbound[0], unbound[1])

        self.assertTrue(s == expected)
        self.assertTrue(len(params) == 0)
コード例 #4
0
ファイル: gremlin.py プロジェクト: wintericie/gremlinpy
    def test_can_add_a_reserved_word_as_apart_of_the_query_as_function_with_args(
            self):
        g = Gremlin()
        init = Function(g, '__init__', ['arg'])

        g.add_token(init)

        s = str(g)
        params = g.bound_params
        arg = get_dict_key(params, 'arg')
        expected = 'g.__init__(%s)' % arg

        self.assertTrue(s == expected)
        self.assertTrue(len(params) == 1)