Browse Source

speed up tests by lowering pow in their configs

python39 release-7.2.0
Kevin Froman 3 months ago
parent
commit
2a6f6bb1aa
5 changed files with 36 additions and 8 deletions
  1. +0
    -4
      tests/test_big_brother.py
  2. +9
    -2
      tests/test_blocklist_class.py
  3. +10
    -1
      tests/test_blocks.py
  4. +12
    -1
      tests/test_storagecounter.py
  5. +5
    -0
      tests/test_timeinsert.py

+ 0
- 4
tests/test_big_brother.py View File

@ -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()

+ 9
- 2
tests/test_blocklist_class.py View File

@ -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):


+ 10
- 1
tests/test_blocks.py View File

@ -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):


+ 12
- 1
tests/test_storagecounter.py View File

@ -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


+ 5
- 0
tests/test_timeinsert.py View File

@ -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')


Loading…
Cancel
Save