[tor-commits] [ooni-probe/develop] Use absolute filepath instead of relative
isis at torproject.org
isis at torproject.org
Thu Jun 6 16:41:38 UTC 2013
commit 3c86abb5d2a728604b97a33c3f989039231205b0
Author: Arturo Filastò <art at fuffa.org>
Date: Mon Apr 22 18:11:32 2013 +0200
Use absolute filepath instead of relative
---
ooni/tests/test_utils.py | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/ooni/tests/test_utils.py b/ooni/tests/test_utils.py
index cc648e0..cafb00f 100644
--- a/ooni/tests/test_utils.py
+++ b/ooni/tests/test_utils.py
@@ -1,19 +1,20 @@
+import os
import unittest
from ooni.utils import pushFilenameStack
-
+basefilename = os.path.abspath('dummyfile')
class TestUtils(unittest.TestCase):
def test_pushFilenameStack(self):
- f = open("dummyfile", "w+")
+ f = open(basefilename, "w+")
f.write("0\n")
f.close()
for i in xrange(1, 5):
- f = open("dummyfile.%s" % i, "w+")
+ f = open(basefilename+".%s" % i, "w+")
f.write("%s\n" % i)
f.close()
- pushFilenameStack("dummyfile")
+ pushFilenameStack(basefilename)
for i in xrange(1, 5):
- f = open("dummyfile.%s" % i)
+ f = open(basefilename+".%s" % i)
c = f.readlines()[0].strip()
self.assertEqual(str(i-1), str(c))
f.close()
More information about the tor-commits
mailing list