From 2a6f6bb1aad06fb199704be7bbe66c9e3b1e0a18 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Thu, 3 Dec 2020 06:36:30 +0000 Subject: [PATCH] speed up tests by lowering pow in their configs --- tests/test_big_brother.py | 4 ---- tests/test_blocklist_class.py | 11 +++++++++-- tests/test_blocks.py | 11 ++++++++++- tests/test_storagecounter.py | 13 ++++++++++++- tests/test_timeinsert.py | 5 +++++ 5 files changed, 36 insertions(+), 8 deletions(-) diff --git a/tests/test_big_brother.py b/tests/test_big_brother.py index 45b03e60..7e9befda 100644 --- a/tests/test_big_brother.py +++ b/tests/test_big_brother.py @@ -24,10 +24,6 @@ class TestBigBrother(unittest.TestCase): requests.get('https://example.com') with self.assertRaises(onionrexceptions.NetworkLeak): requests.get('https://1.1.1.1/') - try: - requests.get('http://192.168.1.1/') - except requests.exceptions.ConnectionError: - pass unittest.main() diff --git a/tests/test_blocklist_class.py b/tests/test_blocklist_class.py index 2091d085..ce46905a 100644 --- a/tests/test_blocklist_class.py +++ b/tests/test_blocklist_class.py @@ -9,11 +9,18 @@ os.environ["ONIONR_HOME"] = TEST_DIR import unittest from utils import identifyhome, createdirs, bettersleep -from onionrsetup import setup_config -from onionrblocks import BlockList, insert +from onionrsetup import setup_config, setup_default_plugins createdirs.create_dirs() setup_config() +setup_config() +setup_default_plugins() + +import config +config.set("general.minimum_block_pow", 2) +config.set('general.minimum_send_pow', 2) +config.save() +from onionrblocks import BlockList, insert class TestBlockList(unittest.TestCase): diff --git a/tests/test_blocks.py b/tests/test_blocks.py index d1915720..c8a4d7aa 100644 --- a/tests/test_blocks.py +++ b/tests/test_blocks.py @@ -11,12 +11,21 @@ from utils import createdirs createdirs.create_dirs() -import onionrblocks import onionrstorage from onionrutils import bytesconverter import onionrcrypto from onionrblocks import onionrblockapi +from onionrsetup import setup_config, setup_default_plugins + +setup_config() +setup_default_plugins() + +import config +config.set("general.minimum_block_pow", 2) +config.set('general.minimum_send_pow', 2) +config.save() +import onionrblocks class OnionrBlockTests(unittest.TestCase): def test_plaintext_insert(self): diff --git a/tests/test_storagecounter.py b/tests/test_storagecounter.py index bc1ddf6c..4b720018 100644 --- a/tests/test_storagecounter.py +++ b/tests/test_storagecounter.py @@ -13,9 +13,20 @@ getourkeypair.get_keypair() import config import logger import onionrsetup as setup -import onionrblocks import filepaths import onionrexceptions + +from onionrsetup import setup_config, setup_default_plugins + +setup_config() +setup_default_plugins() + +import config +config.set("general.minimum_block_pow", 2) +config.set('general.minimum_send_pow', 2) +config.save() +import onionrblocks + from onionrblocks import storagecounter import onionrstorage diff --git a/tests/test_timeinsert.py b/tests/test_timeinsert.py index 6c92ef6f..a3adef75 100644 --- a/tests/test_timeinsert.py +++ b/tests/test_timeinsert.py @@ -17,6 +17,11 @@ from onionrsetup import setup_config, setup_default_plugins setup_config() setup_default_plugins() +import config +config.set("general.minimum_block_pow", 2) +config.set('general.minimum_send_pow', 2) +config.save() + class TestTimeInsert(unittest.TestCase): def test_time_insert_none(self): bl = time_insert('test')