def setUp(self): BanlistTestCase.setUp(self) console = Mock() self.banlist = GuidBanlist(console, ET.fromstring(r""" <guid_banlist> <name>Banlist_name</name> <file>F:\temp\banlist.txt</file> <force_ip_range>no</force_ip_range> <message>$name is BANNED</message> </guid_banlist> """)) # self.banlist.getModifiedTime = Mock(return_value=time.time()) self.banlist.plugin.info = Mock(wraps=lambda x: sys.stdout.write(x + "\n"))
def setUp(self): BanlistTestCase.setUp(self) console = Mock() self.banlist = PbidBanlist(console, ET.fromstring(r""" <pbid_banlist> <name>Banlist_name</name> <file>F:\temp\banlist.txt</file> <force_ip_range>no</force_ip_range> <message>$name is BANNED $pbid</message> </pbid_banlist> """)) # self.banlist.getModifiedTime = Mock(return_value=time.time()) self.banlist.plugin.info = Mock(wraps=lambda x: sys.stdout.write(x + "\n"))
def setUp(self): BanlistTestCase.setUp(self) console = Mock() self.ip_banlist = IpBanlist( console, ET.fromstring(r""" <ip_banlist> <name>Banlist_name</name> <file>F:\temp\banlist.txt</file> <force_ip_range>no</force_ip_range> <message>$name is BANNED</message> </ip_banlist> """)) self.assertFalse(self.ip_banlist._forceRange) self.ip_banlist.plugin.info = Mock( wraps=lambda x: sys.stdout.write(x + "\n"))