Fixed bug in unit tests where we didn't check for the existence of the cache directory before we tried to wipe out all the files in it.
diff --git a/httplib2test.py b/httplib2test.py
index e6e8cd6..c7461d4 100755
--- a/httplib2test.py
+++ b/httplib2test.py
@@ -41,8 +41,10 @@
class HttpTest(unittest.TestCase):
def setUp(self):
- [os.remove(os.path.join(".cache", file)) for file in os.listdir(".cache")]
- self.http = httplib2.Http(".cache")
+ cacheDirName = ".cache"
+ if os.path.exists(cacheDirName):
+ [os.remove(os.path.join(cacheDirName, file)) for file in os.listdir(cacheDirName)]
+ self.http = httplib2.Http(cacheDirName)
self.http.clear_credentials()
def testGetIsDefaultMethod(self):