def test_complex(self): parsed = mask.parse('field1, nested{field, sub{subfield}}, field2') expected = [ 'field1', mask.Nested('nested', ['field', mask.Nested('sub', ['subfield'])]), 'field2' ] self.assertEqual(parsed, expected)
def test_star(self): parsed = mask.parse('nested{field1,field2},*') expected = [mask.Nested('nested', ['field1', 'field2']), '*'] self.assertEqual(parsed, expected)
def test_nested_fields(self): parsed = mask.parse('nested{field1,field2}') expected = [mask.Nested('nested', ['field1', 'field2'])] self.assertEqual(parsed, expected)