From 5e86864298c0a109a132125dd40cb9f6cd5cc97c Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Tue, 10 Sep 2019 21:48:07 -0500 Subject: [PATCH] try to fix storagecounter test in CI --- onionr/tests/test_storagecounter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/onionr/tests/test_storagecounter.py b/onionr/tests/test_storagecounter.py index ec3d9d96..f656683a 100644 --- a/onionr/tests/test_storagecounter.py +++ b/onionr/tests/test_storagecounter.py @@ -3,7 +3,6 @@ sys.path.append(".") import unittest, uuid import logger -import config from utils import createdirs import onionrsetup as setup from utils import createdirs @@ -14,6 +13,7 @@ import storagecounter import onionrstorage def _test_setup(): + import config TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/' print("Test directory:", TEST_DIR) os.environ["ONIONR_HOME"] = TEST_DIR @@ -23,11 +23,13 @@ def _test_setup(): class TestStorageCounter(unittest.TestCase): def test_basic_amount(self): + import config _test_setup() self.assertIsNotNone(config.get('allocations.disk')) self.assertGreater(config.get('allocations.disk'), 1000000) def test_insert_too_much(self): + import config _test_setup() config.set('allocations.disk', 1000) self.assertRaises(onionrexceptions.DiskAllocationReached, onionrblocks.insert, "test")