def test_write_manually(self):
        obj = PtraceRule('read', '/foo', allow_keyword=True)

        expected = '    allow ptrace read peer=/foo,'

        self.assertEqual(expected, obj.get_clean(2), 'unexpected clean rule')
        self.assertEqual(expected, obj.get_raw(2), 'unexpected raw rule')
 def test_empty_data_2(self):
     obj = PtraceRule('read', '/foo')
     obj.peer = ''
     # no ptrace set, and ALL not set
     with self.assertRaises(AppArmorBug):
         obj.get_clean(1)