mirror of https://github.com/fail2ban/fail2ban
BF: fixed up conditioning of tests under cygwin (still 3 fail)
parent
a120ff191a
commit
2aa8ddea4d
|
@ -67,10 +67,12 @@ option = %s
|
|||
os.chmod(f, 0)
|
||||
# fragile test and known to fail e.g. under Cygwin where permissions
|
||||
# seems to be not enforced, thus condition
|
||||
if not os.access('d.conf', os.R_OK):
|
||||
if not os.access(f, os.R_OK):
|
||||
self.assertFalse(self.c.read('d')) # should not be readable BUT present
|
||||
else:
|
||||
raise unittest.SkipTest("Skipping on %s -- access rights are not enforced" % platform)
|
||||
# SkipTest introduced only in 2.7 thus can't yet use generally
|
||||
# raise unittest.SkipTest("Skipping on %s -- access rights are not enforced" % platform)
|
||||
pass
|
||||
|
||||
|
||||
def testOptionalDotDDir(self):
|
||||
|
|
|
@ -84,9 +84,8 @@ def _assert_equal_entries(utest, found, output, count=None):
|
|||
if len(output) > 3 and count is None: # match matches
|
||||
# do not check if custom count (e.g. going through them twice)
|
||||
if os.linesep != '\n' or sys.platform.startswith('cygwin'):
|
||||
# on those where text file lines end with '\r\n', override
|
||||
# repr for this test to disregard trailing CR LF
|
||||
srepr = lambda x: repr(str(x).rstrip('\n\r'))
|
||||
# on those where text file lines end with '\r\n', remove '\r'
|
||||
srepr = lambda x: repr(x).replace(r'\r', '')
|
||||
else:
|
||||
srepr = repr
|
||||
utest.assertEqual(srepr(found[3]), srepr(output[3]))
|
||||
|
|
Loading…
Reference in New Issue