TST: remove deprecated warn method of logging and use warning() instead

pull/519/head
Daniel Black 11 years ago
parent 4ee018a84b
commit 5d2a03e852

@ -670,14 +670,14 @@ class TransmitterLogging(TransmitterBase):
self.server.setLogLevel(2) self.server.setLogLevel(2)
self.assertEqual(self.transm.proceed(["set", "logtarget", fn]), (0, fn)) self.assertEqual(self.transm.proceed(["set", "logtarget", fn]), (0, fn))
l = logging.getLogger('fail2ban.server.server').parent.parent l = logging.getLogger('fail2ban.server.server').parent.parent
l.warn("Before file moved") l.warning("Before file moved")
try: try:
f2, fn2 = tempfile.mkstemp("fail2ban.log") f2, fn2 = tempfile.mkstemp("fail2ban.log")
os.close(f2) os.close(f2)
os.rename(fn, fn2) os.rename(fn, fn2)
l.warn("After file moved") l.warning("After file moved")
self.assertEqual(self.transm.proceed(["flushlogs"]), (0, "rolled over")) self.assertEqual(self.transm.proceed(["flushlogs"]), (0, "rolled over"))
l.warn("After flushlogs") l.warning("After flushlogs")
with open(fn2,'r') as f: with open(fn2,'r') as f:
line1 = f.next() line1 = f.next()
if line1.find('Changed logging target to') >= 0: if line1.find('Changed logging target to') >= 0:

Loading…
Cancel
Save