def test_star(self): condition = rules.starc(rules.rc(eq, 'pdk', 'name', 'c')) assert condition.evaluate(self.a1) assert not condition.evaluate(self.a2) assert not condition.evaluate(self.b1) assert not condition.evaluate(self.c) assert not condition.evaluate(None)
def test_star(self): actual = compile_debish('* apache | apache2', None, None) expected = starc( oc([ ac([rc(eq, 'pdk', 'name', 'apache')]), ac([rc(eq, 'pdk', 'name', 'apache2')]) ])) self.assert_equals(expected, actual)
def parse_star(self, lex): token_type, dummy = lex.peek() if token_type == '*': self.assert_type(lex, '*') token_type, dummy = lex.peek() if token_type == '*': self.assert_type(lex, '*') star = 2 else: star = 1 else: star = 0 condition = self.wrap_condition(self.parse_or(lex)) # here is where we plug in the blob_id and package_type if star == 1: return starc(condition) elif star == 2: return star2c(condition) else: return condition
def test_star(self): actual = compile_debish('* apache | apache2', None, None) expected = starc(oc([ac([rc(eq, 'pdk', 'name', 'apache')]), ac([rc(eq, 'pdk', 'name', 'apache2')])])) self.assert_equals(expected, actual)