def test_can_add_functon_manually_bind_two_args(self): g = Gremlin() bound = g.bind_param('arg') bound2 = g.bind_param('arg2') g.function(bound[0], bound2[0]) string = str(g) expected = 'g.function(%s, %s)' % (bound[0], bound2[0]) self.assertTrue(string == expected) self.assertTrue(len(g.bound_params) == 2)
def test_can_add_functon_manually_bind_one_arg(self): g = Gremlin() bound = g.bind_param('arg') g.function(bound[0]) string = str(g) bind, value = g.bound_params.copy().popitem() expected = 'g.function(%s)' % bind self.assertTrue(string == expected) self.assertTrue(bind == bound[0]) self.assertTrue(value == bound[1]) self.assertTrue(len(g.bound_params) == 1)