mirror of
https://github.com/planetmint/planetmint.git
synced 2025-03-30 15:08:31 +00:00

* Integrate zenroom acceptance test * fixed zenroom reference * added additional dependences to the docker fils so that zenroom can be executed. added zenroom from git repo, because pypi servs an older buggy version * using the custom planetmintdriver branch to avoid pypi zendesk downloads * Added zenroom test * Added zenroom test Signed-off-by: Sangat Das <sangatdas5@gmail.com> * Change reference to planetmint-driver to planetmint-driver-python Signed-off-by: Sangat Das <sangatdas5@gmail.com> * Basic structuring * Added new classes in transactions/common * Added Create and Transfer as separate transactions * Resolved errors related to transactions.common * Fixing imports * Resolved issues of election transaction * Resolve flake8 issues Signed-off-by: Sangat Das <sangatdas5@gmail.com> * Resolve remaining flake8 issues Signed-off-by: Sangat Das <sangatdas5@gmail.com> * Resolve remaining flake8 issues Signed-off-by: Sangat Das <sangatdas5@gmail.com> Co-authored-by: Jürgen Eckel <juergen@riddleandcode.com> Co-authored-by: ArpitShukla007 <arpitnshukla@gmail.com>
64 lines
1.7 KiB
Python
64 lines
1.7 KiB
Python
# Copyright © 2020 Interplanetary Database Association e.V.,
|
|
# Planetmint and IPDB software contributors.
|
|
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
|
|
|
from argparse import Namespace
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_run_configure(monkeypatch):
|
|
from planetmint.commands import planetmint
|
|
monkeypatch.setattr(planetmint, 'run_configure', lambda *args, **kwargs: None)
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_write_config(monkeypatch):
|
|
from planetmint import config_utils
|
|
monkeypatch.setattr(config_utils, 'write_config', lambda *args: None)
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_db_init_with_existing_db(monkeypatch):
|
|
from planetmint.commands import planetmint
|
|
monkeypatch.setattr(planetmint, '_run_init', lambda: None)
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_processes_start(monkeypatch):
|
|
from planetmint import start
|
|
monkeypatch.setattr(start, 'start', lambda *args: None)
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_generate_key_pair(monkeypatch):
|
|
monkeypatch.setattr('planetmint.transactions.common.crypto.generate_key_pair', lambda: ('privkey', 'pubkey'))
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_planetmint_backup_config(monkeypatch):
|
|
config = {
|
|
'database': {'host': 'host', 'port': 12345, 'name': 'adbname'},
|
|
}
|
|
monkeypatch.setattr('planetmint._config', config)
|
|
|
|
|
|
@pytest.fixture
|
|
def run_start_args(request):
|
|
param = getattr(request, 'param', {})
|
|
return Namespace(
|
|
config=param.get('config'),
|
|
skip_initialize_database=param.get('skip_initialize_database', False),
|
|
)
|
|
|
|
|
|
@pytest.fixture
|
|
def mocked_setup_logging(mocker):
|
|
return mocker.patch(
|
|
'planetmint.log.setup_logging',
|
|
autospec=True,
|
|
spec_set=True,
|
|
)
|