summaryrefslogtreecommitdiff
path: root/tests/test_utils.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-03-28 10:14:26 +0000
committerGerrit Code Review <review@openstack.org>2014-03-28 10:14:26 +0000
commit14f0c89cc10d1705bf9267908e69ce1221da14c6 (patch)
treeafcd47ad6ebcd278ee3b24cd45c1021aad123be7 /tests/test_utils.py
parent7dcefe1b6422b418d1a3746e03fe36d8855f32c7 (diff)
parent9c85ea7a7521c12bf4ebd8c7bf93fe5928e36a05 (diff)
downloadpython-swiftclient-14f0c89cc10d1705bf9267908e69ce1221da14c6.tar.gz
Merge "Python 3: Fix tests using temporary text files"
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r--tests/test_utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 22af6ac..4c4b29d 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -133,7 +133,7 @@ class TestLengthWrapper(testtools.TestCase):
self.assertEqual('a' * 42, read_data)
def test_tempfile(self):
- with tempfile.NamedTemporaryFile() as f:
+ with tempfile.NamedTemporaryFile(mode='w') as f:
f.write('a' * 100)
f.flush()
contents = open(f.name)
@@ -144,7 +144,7 @@ class TestLengthWrapper(testtools.TestCase):
self.assertEqual('a' * 42, read_data)
def test_segmented_file(self):
- with tempfile.NamedTemporaryFile() as f:
+ with tempfile.NamedTemporaryFile(mode='w') as f:
segment_length = 1024
segments = ('a', 'b', 'c', 'd')
for c in segments: