13 lines
389 B
Python
13 lines
389 B
Python
|
|
import unittest
|
||
|
|
|
||
|
|
from policy import Policy
|
||
|
|
|
||
|
|
|
||
|
|
class HoldoutPolicyTests(unittest.TestCase):
|
||
|
|
def test_unrelated_flag_change_preserves_correct_answers(self):
|
||
|
|
policy = Policy({"a": True, "b": False})
|
||
|
|
self.assertTrue(policy.allows("u", "a"))
|
||
|
|
policy.set_flag("b", True)
|
||
|
|
self.assertTrue(policy.allows("u", "a"))
|
||
|
|
self.assertTrue(policy.allows("u", "b"))
|