From fd6660aba193580c83a5c1d180053a8d28546c28 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Tue, 10 Sep 2019 21:53:28 -0500 Subject: [PATCH] try to fix storagecounter test in CI --- .gitlab-ci.yml | 2 +- onionr/onionrsetup/setupconfig.py | 3 ++- onionr/tests/test_storagecounter.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7c0d5dc2..7a278f5b 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,5 +3,5 @@ test: script: - apt-get update -qy - apt-get install -y python3-pip tor - - pip3 install -r requirements.txt + - pip3 install --require-hashes -r requirements.txt - make test diff --git a/onionr/onionrsetup/setupconfig.py b/onionr/onionrsetup/setupconfig.py index 21c408b7..d014efd7 100755 --- a/onionr/onionrsetup/setupconfig.py +++ b/onionr/onionrsetup/setupconfig.py @@ -23,7 +23,6 @@ from etc import onionrvalues from logger.settings import * def setup_config(): - config.reload() if not os.path.exists(config._configfile): if os.path.exists('static-data/default_config.json'): @@ -33,6 +32,8 @@ def setup_config(): config.save() + config.reload() + settings = 0b000 if config.get('log.console.color', True): settings = settings | USE_ANSI diff --git a/onionr/tests/test_storagecounter.py b/onionr/tests/test_storagecounter.py index f656683a..64753727 100644 --- a/onionr/tests/test_storagecounter.py +++ b/onionr/tests/test_storagecounter.py @@ -26,7 +26,7 @@ class TestStorageCounter(unittest.TestCase): import config _test_setup() self.assertIsNotNone(config.get('allocations.disk')) - self.assertGreater(config.get('allocations.disk'), 1000000) + self.assertGreaterEqual(config.get('allocations.disk'), 1000000) def test_insert_too_much(self): import config