コード例 #1
0
 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)
コード例 #2
0
ファイル: test_rules.py プロジェクト: 64studio/pdk
 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)
コード例 #3
0
 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)
コード例 #4
0
ファイル: debish_condition.py プロジェクト: pombredanne/pdk
    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
コード例 #5
0
ファイル: debish_condition.py プロジェクト: 64studio/pdk
    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
コード例 #6
0
ファイル: test_debish_condition.py プロジェクト: 64studio/pdk
 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)