示例#1
0
class FirewallRulesGetCommandTestCase(unittest.TestCase):
    """
    Тест на L{spamfighter.api.message.firewall.FirewallRulesGetCommand}.
    """

    def setUp(self):
        self.c = FirewallRulesGetCommand()
        self.firewall = MessageFirewall('stop as SPAMMER')
        getDefaultDomain().set('testFIREWALL', self.firewall)

    def tearDown(self):
        getDefaultDomain().delete('testFIREWALL')

    def testRun(self):
        self.c.params.getUnserialized({'partner' : None, 'firewall' : 'testFIREWALL'})
        return self.c.run().addCallback(lambda _: self.assertEquals('stop as SPAMMER', self.c.result.rules))
示例#2
0
 def setUp(self):
     self.c = FirewallRulesGetCommand()
     self.firewall = MessageFirewall('stop as SPAMMER')
     getDefaultDomain().set('testFIREWALL', self.firewall)