From 7de2efbee7b8770e890520c5008890ca6ab88b89 Mon Sep 17 00:00:00 2001 From: ArpitShukla007 Date: Tue, 7 Jun 2022 09:42:13 +0000 Subject: [PATCH] resolved comments and clean-up of unused code --- planetmint/backend/localmongodb/query.py | 2 +- planetmint/config_utils.py | 2 +- planetmint/transactions/common/transaction.py | 5 +--- setup.py | 28 +++++++++---------- tests/test_core.py | 2 -- 5 files changed, 17 insertions(+), 22 deletions(-) diff --git a/planetmint/backend/localmongodb/query.py b/planetmint/backend/localmongodb/query.py index 6d103f5..d8bc464 100644 --- a/planetmint/backend/localmongodb/query.py +++ b/planetmint/backend/localmongodb/query.py @@ -1,6 +1,6 @@ from functools import singledispatch # Copyright © 2020 Interplanetary Database Association e.V., -# BigchainDB and IPDB software contributors. +# 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 diff --git a/planetmint/config_utils.py b/planetmint/config_utils.py index c3ac0e4..ecd005c 100644 --- a/planetmint/config_utils.py +++ b/planetmint/config_utils.py @@ -189,7 +189,7 @@ def set_config(config): Any previous changes made to ``planetmint.config`` will be lost. """ # Deep copy the default config into planetmint.config - _config = Config().get() #copy.deepcopy(planetmint._config) + _config = Config().get() # Update the default config with whatever is in the passed config update(_config, update_types(config, _config)) _config['CONFIGURED'] = True diff --git a/planetmint/transactions/common/transaction.py b/planetmint/transactions/common/transaction.py index 56ad5d0..dd05f30 100644 --- a/planetmint/transactions/common/transaction.py +++ b/planetmint/transactions/common/transaction.py @@ -653,9 +653,7 @@ class Transaction(object): 'version': tx['version'], 'id': id } - - # print( f" Schema validation {tx}") - # print( f" Schema validation {local_dict}") + if not skip_schema_validation: cls.validate_id(local_dict) cls.validate_schema(local_dict) @@ -702,7 +700,6 @@ class Transaction(object): tx_ids = list(tx_map.keys()) metadata_list = list(planet.get_metadata(tx_ids)) for metadata in metadata_list: - # print (f"\n\nmetadata: { metadata}") if 'id' in metadata: tx = tx_map[metadata['id']] tx.update({'metadata': metadata.get('metadata')}) diff --git a/setup.py b/setup.py index a2d3951..06a4aee 100644 --- a/setup.py +++ b/setup.py @@ -59,20 +59,20 @@ dev_require = [ ] tests_require = [ - 'coverage', - 'pep8', - 'flake8', - 'flake8-quotes==0.8.1', - 'hypothesis>=5.3.0', - 'pytest>=3.0.0', - 'pytest-cov==2.8.1', - 'pytest-mock', - 'pytest-xdist', - 'pytest-flask', - 'pytest-aiohttp', - 'pytest-asyncio', - 'tox', - ] + docs_require + 'coverage', + 'pep8', + 'flake8', + 'flake8-quotes==0.8.1', + 'hypothesis>=5.3.0', + 'pytest>=3.0.0', + 'pytest-cov==2.8.1', + 'pytest-mock', + 'pytest-xdist', + 'pytest-flask', + 'pytest-aiohttp', + 'pytest-asyncio', + 'tox', +] + docs_require install_requires = [ 'chardet==3.0.4', diff --git a/tests/test_core.py b/tests/test_core.py index 35c43d3..5e09677 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -162,8 +162,6 @@ def test_init_chain_successfully_registers_chain(b): request = generate_init_chain_request('chain-XYZ') res = App(b).init_chain(request) assert res == types.ResponseInitChain() - - print('############# CONNECTION ############') print(b.connection) chain = query.get_latest_abci_chain(b.connection)