def test_allows_if_rule_allows_and_no_include(self): allow = qvarn.FilterAllow() include = qvarn.FilterInclude({}, allow) self.assertTrue(include.allow(None))
def test_allows_if_rule_denies_and_include_is_false(self): deny = qvarn.FilterDeny() include = qvarn.FilterInclude({'include': False}, deny) self.assertTrue(include.allow({}))
def test_allows_if_rule_allows_and_include_is_true(self): allow = qvarn.FilterAllow() include = qvarn.FilterInclude({'include': True}, allow) self.assertTrue(include.allow({}))
def test_denies_if_rule_allows_and_include_is_false(self): allow = qvarn.FilterAllow() include = qvarn.FilterInclude({'include': False}, allow) self.assertFalse(include.allow({}))
def test_denies_if_rule_denies_and_no_include(self): deny = qvarn.FilterDeny() include = qvarn.FilterInclude({}, deny) self.assertFalse(include.allow(None))