示例#1
0
 def test_filter_from_non_operator_arg(self):
     pair = Filter.from_arg('name', '12')
     self.assertEqual('name', pair.name)
     self.assertEqual(12, pair.value)
     self.assertEqual(operator.eq, pair.operator)
示例#2
0
 def test_filter_from_gt_operator_arg(self):
     pair = Filter.from_arg('age[gt]', '18')
     self.assertEqual('age', pair.name)
     self.assertEqual(18, pair.value)
     self.assertEqual(operator.gt, pair.operator)
示例#3
0
def get_arg(args, arg, ignore_type):
    return Filter.from_arg(arg, args[arg], ignore_type)