Updates tests to dissable logging based on 17e6066

This commit is contained in:
Sergi Delgado Segura
2019-10-26 14:22:21 -07:00
parent f61474216c
commit dfaec51a3b
11 changed files with 25 additions and 19 deletions

View File

@@ -5,14 +5,14 @@ from hashlib import sha256
from binascii import unhexlify from binascii import unhexlify
from apps.cli.blob import Blob from apps.cli.blob import Blob
from pisa import HOST, PORT, logging from pisa import HOST, PORT, c_logger
from test.simulator.utils import sha256d from test.simulator.utils import sha256d
from test.simulator.transaction import TX from test.simulator.transaction import TX
from pisa.utils.auth_proxy import AuthServiceProxy from pisa.utils.auth_proxy import AuthServiceProxy
from test.unit.conftest import generate_block, get_random_value_hex from test.unit.conftest import generate_block, get_random_value_hex
from pisa.conf import BTC_RPC_USER, BTC_RPC_PASSWD, BTC_RPC_HOST, BTC_RPC_PORT, MAX_APPOINTMENTS from pisa.conf import BTC_RPC_USER, BTC_RPC_PASSWD, BTC_RPC_HOST, BTC_RPC_PORT, MAX_APPOINTMENTS
logging.getLogger().disabled = True c_logger.disabled = True
PISA_API = "http://{}:{}".format(HOST, PORT) PISA_API = "http://{}:{}".format(HOST, PORT)
MULTIPLE_APPOINTMENTS = 10 MULTIPLE_APPOINTMENTS = 10

View File

@@ -1,11 +1,14 @@
import json import json
from pytest import fixture from pytest import fixture
from pisa import c_logger
from pisa.appointment import Appointment from pisa.appointment import Appointment
from pisa.encrypted_blob import EncryptedBlob from pisa.encrypted_blob import EncryptedBlob
from test.unit.conftest import get_random_value_hex from test.unit.conftest import get_random_value_hex
c_logger.disabled = True
# Not much to test here, adding it for completeness # Not much to test here, adding it for completeness
@fixture @fixture

View File

@@ -1,11 +1,11 @@
from binascii import unhexlify from binascii import unhexlify
from pisa import logging from pisa import c_logger
from apps.cli.blob import Blob from apps.cli.blob import Blob
from test.unit.conftest import get_random_value_hex from test.unit.conftest import get_random_value_hex
from pisa.conf import SUPPORTED_CIPHERS, SUPPORTED_HASH_FUNCTIONS from pisa.conf import SUPPORTED_CIPHERS, SUPPORTED_HASH_FUNCTIONS
logging.getLogger().disabled = True c_logger.disabled = True
def test_init_blob(): def test_init_blob():

View File

@@ -1,13 +1,13 @@
import pytest import pytest
import logging
from uuid import uuid4 from uuid import uuid4
from hashlib import sha256 from hashlib import sha256
from binascii import unhexlify from binascii import unhexlify
from pisa import c_logger
from pisa.block_processor import BlockProcessor from pisa.block_processor import BlockProcessor
from test.unit.conftest import get_random_value_hex from test.unit.conftest import get_random_value_hex
logging.getLogger().disabled = True c_logger.disabled = True
APPOINTMENT_COUNT = 100 APPOINTMENT_COUNT = 100
TEST_SET_SIZE = 200 TEST_SET_SIZE = 200

View File

@@ -1,6 +1,6 @@
import pytest import pytest
import logging
from pisa import c_logger
from pisa.carrier import Carrier from pisa.carrier import Carrier
from test.simulator.utils import sha256d from test.simulator.utils import sha256d
from test.simulator.transaction import TX from test.simulator.transaction import TX
@@ -8,7 +8,7 @@ from test.unit.conftest import generate_blocks
from test.unit.conftest import get_random_value_hex from test.unit.conftest import get_random_value_hex
from pisa.rpc_errors import RPC_VERIFY_ALREADY_IN_CHAIN, RPC_DESERIALIZATION_ERROR from pisa.rpc_errors import RPC_VERIFY_ALREADY_IN_CHAIN, RPC_DESERIALIZATION_ERROR
logging.getLogger().disabled = True c_logger.disabled = True
# FIXME: This test do not fully cover the carrier since the simulator does not support every single error bitcoind may # FIXME: This test do not fully cover the carrier since the simulator does not support every single error bitcoind may
# return for RPC_VERIFY_REJECTED and RPC_VERIFY_ERROR. Further development of the simulator / mocks or simulation # return for RPC_VERIFY_REJECTED and RPC_VERIFY_ERROR. Further development of the simulator / mocks or simulation

View File

@@ -1,7 +1,7 @@
import random import random
from uuid import uuid4 from uuid import uuid4
from pisa import logging from pisa import c_logger
from pisa.responder import Job from pisa.responder import Job
from pisa.cleaner import Cleaner from pisa.cleaner import Cleaner
from pisa.appointment import Appointment from pisa.appointment import Appointment
@@ -12,7 +12,7 @@ ITEMS = 10
MAX_ITEMS = 100 MAX_ITEMS = 100
ITERATIONS = 1000 ITERATIONS = 1000
logging.getLogger().disabled = True c_logger.disabled = True
def set_up_appointments(total_appointments): def set_up_appointments(total_appointments):

View File

@@ -1,8 +1,8 @@
from pisa import logging from pisa import c_logger
from pisa.encrypted_blob import EncryptedBlob from pisa.encrypted_blob import EncryptedBlob
from test.unit.conftest import get_random_value_hex from test.unit.conftest import get_random_value_hex
logging.getLogger().disabled = True c_logger.disabled = True
def test_init_encrypted_blob(): def test_init_encrypted_blob():

View File

@@ -1,6 +1,6 @@
from binascii import unhexlify from binascii import unhexlify
from pisa import logging from pisa import c_logger
from pisa.errors import * from pisa.errors import *
from pisa.inspector import Inspector from pisa.inspector import Inspector
from pisa.appointment import Appointment from pisa.appointment import Appointment
@@ -8,6 +8,8 @@ from pisa.block_processor import BlockProcessor
from test.unit.conftest import get_random_value_hex from test.unit.conftest import get_random_value_hex
from pisa.conf import MIN_DISPUTE_DELTA, SUPPORTED_CIPHERS, SUPPORTED_HASH_FUNCTIONS from pisa.conf import MIN_DISPUTE_DELTA, SUPPORTED_CIPHERS, SUPPORTED_HASH_FUNCTIONS
c_logger.disabled = True
inspector = Inspector() inspector = Inspector()
APPOINTMENT_OK = (0, None) APPOINTMENT_OK = (0, None)
@@ -15,8 +17,6 @@ NO_HEX_STRINGS = ["R" * 64, get_random_value_hex(31) + "PP", "$"*64, " "*64]
WRONG_TYPES = [[], '', get_random_value_hex(32), 3.2, 2.0, (), object, {}, " "*32, object()] WRONG_TYPES = [[], '', get_random_value_hex(32), 3.2, 2.0, (), object, {}, " "*32, object()]
WRONG_TYPES_NO_STR = [[], unhexlify(get_random_value_hex(32)), 3.2, 2.0, (), object, {}, object()] WRONG_TYPES_NO_STR = [[], unhexlify(get_random_value_hex(32)), 3.2, 2.0, (), object, {}, object()]
logging.getLogger().disabled = True
def test_check_locator(): def test_check_locator():
# Right appointment type, size and format # Right appointment type, size and format

View File

@@ -4,6 +4,7 @@ from uuid import uuid4
from threading import Thread from threading import Thread
from queue import Queue, Empty from queue import Queue, Empty
from pisa import c_logger
from pisa.tools import check_txid_format from pisa.tools import check_txid_format
from test.simulator.utils import sha256d from test.simulator.utils import sha256d
from pisa.responder import Responder, Job from pisa.responder import Responder, Job
@@ -13,6 +14,8 @@ from test.unit.conftest import get_random_value_hex
from test.unit.conftest import generate_block, generate_blocks from test.unit.conftest import generate_block, generate_blocks
from pisa.conf import BTC_RPC_USER, BTC_RPC_PASSWD, BTC_RPC_HOST, BTC_RPC_PORT from pisa.conf import BTC_RPC_USER, BTC_RPC_PASSWD, BTC_RPC_HOST, BTC_RPC_PORT
c_logger.disabled = True
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def responder(db_manager): def responder(db_manager):

View File

@@ -1,8 +1,8 @@
from pisa import logging from pisa import c_logger
from pisa.tools import check_txid_format from pisa.tools import check_txid_format
from pisa.tools import can_connect_to_bitcoind, in_correct_network, bitcoin_cli from pisa.tools import can_connect_to_bitcoind, in_correct_network, bitcoin_cli
logging.getLogger().disabled = True c_logger.disabled = True
def test_in_correct_network(run_bitcoind): def test_in_correct_network(run_bitcoind):

View File

@@ -1,5 +1,4 @@
import pytest import pytest
import logging
from uuid import uuid4 from uuid import uuid4
from hashlib import sha256 from hashlib import sha256
from threading import Thread from threading import Thread
@@ -12,6 +11,7 @@ from cryptography.hazmat.primitives.serialization import load_pem_private_key
from cryptography.hazmat.primitives.asymmetric import ec from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.exceptions import InvalidSignature from cryptography.exceptions import InvalidSignature
from pisa import c_logger
from apps.cli.blob import Blob from apps.cli.blob import Blob
from pisa.watcher import Watcher from pisa.watcher import Watcher
from pisa.responder import Responder from pisa.responder import Responder
@@ -24,7 +24,7 @@ from pisa.utils.auth_proxy import AuthServiceProxy
from test.unit.conftest import generate_block, generate_blocks from test.unit.conftest import generate_block, generate_blocks
from pisa.conf import EXPIRY_DELTA, BTC_RPC_USER, BTC_RPC_PASSWD, BTC_RPC_HOST, BTC_RPC_PORT, PISA_SECRET_KEY from pisa.conf import EXPIRY_DELTA, BTC_RPC_USER, BTC_RPC_PASSWD, BTC_RPC_HOST, BTC_RPC_PORT, PISA_SECRET_KEY
logging.getLogger().disabled = True c_logger.disabled = True
APPOINTMENTS = 5 APPOINTMENTS = 5
START_TIME_OFFSET = 1 START_TIME_OFFSET = 1