示例#1
0
    def testParseTerm(self):
        parser = self.Parser('term testy {\ntarget::Test\n}')
        expected = policy_simple.Term('testy')
        expected.AddField(policy_simple.Target('Test'))

        pol = parser.Parse()
        self.assertEqual(expected, pol.members[0])
示例#2
0
    def testParseHeader(self):
        parser = self.Parser('header {\ntarget::Test\n}')
        expected = policy_simple.Header()
        expected.AddField(policy_simple.Target('Test'))

        pol = parser.Parse()
        self.assertEqual(expected, pol.members[0])