Exemple #1
0
    def test_102_set_weight_low(self):
        """PermMap set weight high"""
        permmap = PermissionMap("tests/perm_map")
        with self.assertRaises(ValueError):
            permmap.set_weight("infoflow2", "low_w", 11)

        with self.assertRaises(ValueError):
            permmap.set_weight("infoflow2", "low_w", 50)
Exemple #2
0
 def test_100_set_weight(self):
     """PermMap set weight"""
     permmap = PermissionMap("tests/perm_map")
     self.validate_permmap_entry(permmap._permmap, 'infoflow2', 'low_w',
                                 'w', 1, True)
     permmap.set_weight("infoflow2", "low_w", 10)
     self.validate_permmap_entry(permmap._permmap, 'infoflow2', 'low_w',
                                 'w', 10, True)
Exemple #3
0
    def test_102_set_weight_low(self):
        """PermMap set weight high"""
        permmap = PermissionMap("tests/perm_map")
        with self.assertRaises(ValueError):
            permmap.set_weight("infoflow2", "low_w", 11)

        with self.assertRaises(ValueError):
            permmap.set_weight("infoflow2", "low_w", 50)
Exemple #4
0
 def test_104_set_weight_unmapped_permission(self):
     """PermMap set weight unmapped class"""
     permmap = PermissionMap("tests/perm_map")
     with self.assertRaises(UnmappedPermission):
         permmap.set_weight("infoflow2", "UNMAPPED", 10)
Exemple #5
0
 def test_103_set_weight_unmapped_class(self):
     """PermMap set weight unmapped class"""
     permmap = PermissionMap("tests/perm_map")
     with self.assertRaises(UnmappedClass):
         permmap.set_weight("UNMAPPED", "write", 10)
Exemple #6
0
 def test_104_set_weight_unmapped_permission(self):
     """PermMap set weight unmapped class"""
     permmap = PermissionMap("tests/perm_map")
     with self.assertRaises(UnmappedPermission):
         permmap.set_weight("infoflow2", "UNMAPPED", 10)
Exemple #7
0
 def test_103_set_weight_unmapped_class(self):
     """PermMap set weight unmapped class"""
     permmap = PermissionMap("tests/perm_map")
     with self.assertRaises(UnmappedClass):
         permmap.set_weight("UNMAPPED", "write", 10)
Exemple #8
0
 def test_100_set_weight(self):
     """PermMap set weight"""
     permmap = PermissionMap("tests/perm_map")
     self.validate_permmap_entry(permmap.permmap, 'infoflow2', 'low_w', 'w', 1, True)
     permmap.set_weight("infoflow2", "low_w", 10)
     self.validate_permmap_entry(permmap.permmap, 'infoflow2', 'low_w', 'w', 10, True)