示例#1
0
    def testCompile2(self):
        d = DoFirewallStatement(func_name="ruleFalse", func_args={}).compile(defer.succeed(self.pack))

        def check(pack):
            self.assert_(pack is self.pack)

        d.addCallback(check)
        return d
示例#2
0
    def testCompile4(self):
        d = DoFirewallStatement(func_name="ruleTrue", func_args={}, markers=["aaa", "bbb"], if_tags=["c"]).compile(
            defer.succeed(self.pack)
        )

        def check(pack):
            self.assert_(pack is self.pack)
            self.assert_(pack.message.checkHasNoTags(["aaa", "bbb"]))

        d.addCallback(check)
        return d