From: Arun Babu Neelicattu abn@redhat.com
--- tests/__init__.py | 4 ++-- tests/misc.py | 2 +- tests/rw_functional.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/tests/__init__.py b/tests/__init__.py index 4bf7541..10df4b4 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -43,8 +43,8 @@ def diff(orig, new): def difffile(expect, filename): expect += '\n' if not os.path.exists(filename) or os.getenv("__BUGZILLA_UNITTEST_REGEN"): - file(filename, "w").write(expect) - ret = diff(file(filename).read(), expect) + open(filename, "w").write(expect) + ret = diff(open(filename).read(), expect) if ret: raise AssertionError("Output was different:\n%s" % ret)
diff --git a/tests/misc.py b/tests/misc.py index 6f800ec..0fa69a2 100644 --- a/tests/misc.py +++ b/tests/misc.py @@ -87,7 +87,7 @@ class MiscAPI(unittest.TestCase):
# Mozilla should be converted inplace to LWP bugzilla.Bugzilla3(url=None, cookiefile=cookiesnew) - self.assertEquals(file(cookiesmoz).read(), file(cookiesnew).read()) + self.assertEquals(open(cookiesmoz).read(), open(cookiesnew).read())
# Make sure bad cookies raise an error try: diff --git a/tests/rw_functional.py b/tests/rw_functional.py index ce06265..e4b0296 100644 --- a/tests/rw_functional.py +++ b/tests/rw_functional.py @@ -42,7 +42,7 @@ class BaseTest(unittest.TestCase): cookiefile = cf domain = urllib2.urlparse.urlparse(self.url)[1] if os.path.exists(cookiefile): - out = file(cookiefile).read(1024) + out = open(cookiefile).read(1024) if domain in out: return
@@ -509,8 +509,8 @@ class RHPartnerTest(BaseTest):
self.assertEquals(len(out), 3) self.assertEquals(fname, "bz-attach-get1.txt") - self.assertEquals(file(fname).read(), - file(testfile).read()) + self.assertEquals(open(fname).read(), + open(testfile).read()) os.unlink(fname)
# Get all attachments