mirror of
https://github.com/aljazceru/python-teos.git
synced 2026-02-02 21:24:31 +01:00
First commands with basic structure.
- Moves DBManager to common.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import pytest
|
||||
import random
|
||||
from shutil import rmtree
|
||||
|
||||
from common.db_manager import DBManager
|
||||
|
||||
|
||||
@pytest.fixture(scope="session", autouse=True)
|
||||
@@ -7,6 +10,17 @@ def prng_seed():
|
||||
random.seed(0)
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def db_manager():
|
||||
manager = DBManager("test_db")
|
||||
# Add last know block for the Responder in the db
|
||||
|
||||
yield manager
|
||||
|
||||
manager.db.close()
|
||||
rmtree("test_db")
|
||||
|
||||
|
||||
def get_random_value_hex(nbytes):
|
||||
pseudo_random_value = random.getrandbits(8 * nbytes)
|
||||
prv_hex = "{:x}".format(pseudo_random_value)
|
||||
|
||||
@@ -2,8 +2,8 @@ import os
|
||||
import shutil
|
||||
import pytest
|
||||
|
||||
from teos.db_manager import DBManager
|
||||
from test.teos.unit.conftest import get_random_value_hex
|
||||
from common.db_manager import DBManager
|
||||
from test.common.unit.conftest import get_random_value_hex
|
||||
|
||||
|
||||
def open_create_db(db_path):
|
||||
Reference in New Issue
Block a user