made index.TestCase run independant of cwd

This commit is contained in:
Michael Pöhn 2018-08-14 10:08:03 +02:00
parent edb8d105b0
commit 37e0dce73b
1 changed files with 3 additions and 1 deletions

View File

@ -95,7 +95,7 @@ class IndexTest(unittest.TestCase):
head.return_value.headers = {'ETag': 'new_etag'}
get.return_value.headers = {'ETag': 'new_etag'}
get.return_value.status_code = 200
testfile = os.path.join(os.path.dirname(__file__), 'signindex', 'guardianproject-v1.jar')
testfile = os.path.join('signindex', 'guardianproject-v1.jar')
with open(testfile, 'rb') as file:
get.return_value.content = file.read()
@ -217,6 +217,8 @@ class IndexTest(unittest.TestCase):
if __name__ == "__main__":
os.chdir(os.path.dirname(__file__))
parser = optparse.OptionParser()
parser.add_option("-v", "--verbose", action="store_true", default=False,
help="Spew out even more information than normal")