

def testParseAliases(self):
    test_data = '\n    User_Alias basic = a , b, c\n    User_Alias left = a, b, c :\\\n               right = d, e, f\n    User_Alias complex = #1000, %group, %#1001, %:nonunix, %:#1002\n    '
    contents = StringIO.StringIO(test_data)
    config = config_file.SudoersParser()
    result = list(self.Parse(None, contents, None))
    golden = {
        'aliases': [{
            'name': 'basic',
            'type': 'USER',
            'users': ['a', 'b', 'c'],
        }, {
            'name': 'left',
            'type': 'USER',
            'users': ['a', 'b', 'c'],
        }, {
            'name': 'right',
            'type': 'USER',
            'users': ['d', 'e', 'f'],
        }, {
            'name': 'complex',
            'type': 'USER',
            'users': ['#1000', '%group', '%#1001', '%:nonunix', '%:#1002'],
        }],
    }
    self.assertDictEqual(result[0].ToPrimitiveDict(), golden)

dataset/ETHPy150Open google/grr/grr/parsers/config_file_test.py SudoersParserTest.testParseAliases/VarMisuse@35/139 `config`->`self`