Kaydet (Commit) 7dcb8448 authored tarafından Guido van Rossum's avatar Guido van Rossum

More str/bytes strictness.

üst 7d5baac8
......@@ -143,7 +143,7 @@ class PosixPathTest(unittest.TestCase):
def test_getsize(self):
f = open(test_support.TESTFN, "wb")
try:
f.write("foo")
f.write(b"foo")
f.close()
self.assertEqual(posixpath.getsize(test_support.TESTFN), 3)
finally:
......@@ -153,10 +153,10 @@ class PosixPathTest(unittest.TestCase):
def test_time(self):
f = open(test_support.TESTFN, "wb")
try:
f.write("foo")
f.write(b"foo")
f.close()
f = open(test_support.TESTFN, "ab")
f.write("bar")
f.write(b"bar")
f.close()
f = open(test_support.TESTFN, "rb")
d = f.read()
......@@ -175,7 +175,7 @@ class PosixPathTest(unittest.TestCase):
self.assertIs(posixpath.islink(test_support.TESTFN + "1"), False)
f = open(test_support.TESTFN + "1", "wb")
try:
f.write("foo")
f.write(b"foo")
f.close()
self.assertIs(posixpath.islink(test_support.TESTFN + "1"), False)
if hasattr(os, "symlink"):
......@@ -195,7 +195,7 @@ class PosixPathTest(unittest.TestCase):
self.assertIs(posixpath.exists(test_support.TESTFN), False)
f = open(test_support.TESTFN, "wb")
try:
f.write("foo")
f.write(b"foo")
f.close()
self.assertIs(posixpath.exists(test_support.TESTFN), True)
self.assertIs(posixpath.lexists(test_support.TESTFN), True)
......@@ -209,7 +209,7 @@ class PosixPathTest(unittest.TestCase):
self.assertIs(posixpath.isdir(test_support.TESTFN), False)
f = open(test_support.TESTFN, "wb")
try:
f.write("foo")
f.write(b"foo")
f.close()
self.assertIs(posixpath.isdir(test_support.TESTFN), False)
os.remove(test_support.TESTFN)
......@@ -226,7 +226,7 @@ class PosixPathTest(unittest.TestCase):
self.assertIs(posixpath.isfile(test_support.TESTFN), False)
f = open(test_support.TESTFN, "wb")
try:
f.write("foo")
f.write(b"foo")
f.close()
self.assertIs(posixpath.isfile(test_support.TESTFN), True)
os.remove(test_support.TESTFN)
......@@ -242,7 +242,7 @@ class PosixPathTest(unittest.TestCase):
def test_samefile(self):
f = open(test_support.TESTFN + "1", "wb")
try:
f.write("foo")
f.write(b"foo")
f.close()
self.assertIs(
posixpath.samefile(
......@@ -267,7 +267,7 @@ class PosixPathTest(unittest.TestCase):
)
os.remove(test_support.TESTFN + "2")
f = open(test_support.TESTFN + "2", "wb")
f.write("bar")
f.write(b"bar")
f.close()
self.assertIs(
posixpath.samefile(
......@@ -285,7 +285,7 @@ class PosixPathTest(unittest.TestCase):
def test_samestat(self):
f = open(test_support.TESTFN + "1", "wb")
try:
f.write("foo")
f.write(b"foo")
f.close()
self.assertIs(
posixpath.samestat(
......@@ -308,7 +308,7 @@ class PosixPathTest(unittest.TestCase):
)
os.remove(test_support.TESTFN + "2")
f = open(test_support.TESTFN + "2", "wb")
f.write("bar")
f.write(b"bar")
f.close()
self.assertIs(
posixpath.samestat(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment