[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [ooni-probe/master] Use absolute filepath instead of relative
commit 3c86abb5d2a728604b97a33c3f989039231205b0
Author: Arturo Filastò <art@xxxxxxxxx>
Date: Mon Apr 22 18:11:32 2013 +0200
Use absolute filepath instead of relative
---
ooni/tests/test_utils.py | 11 ++++++-----
1 files 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()
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits