Skip to content

Commit c058686

Browse files
kansicodegeschrei
authored andcommitted
Problem: Driver tests failing (#380)
* Problem: Driver tests failing Solution: Fix necessary tests for release. * Problem: Fixture transaction not commited Solution: Post the transaction with 'commit' mode * Fix attempt 1 * Problem: bdb_node_pubkey is not available, Solution: Remove bdb_node_pubkey. Update the fixture transactions_api_full_url to have paramter 'mode=commit
1 parent c1a3afd commit c058686

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

tests/conftest.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,6 @@ def bdb_port():
171171
return environ.get('BDB_PORT', '9984')
172172

173173

174-
@fixture
175-
def bdb_node_pubkey():
176-
return environ['BIGCHAINDB_KEYPAIR_PUBLIC']
177-
178-
179174
@fixture
180175
def bdb_node(bdb_host, bdb_port):
181176
return 'http://{host}:{port}'.format(host=bdb_host, port=bdb_port)
@@ -194,7 +189,7 @@ def api_root(bdb_node):
194189

195190
@fixture
196191
def transactions_api_full_url(api_root):
197-
return api_root + '/transactions'
192+
return api_root + '/transactions?mode=commit'
198193

199194

200195
@fixture
@@ -239,7 +234,6 @@ def signed_alice_transaction(alice_privkey, alice_transaction_obj):
239234

240235

241236
@fixture
242-
@await_transaction
243237
def persisted_alice_transaction(signed_alice_transaction,
244238
transactions_api_full_url):
245239
response = requests.post(transactions_api_full_url,
@@ -310,7 +304,6 @@ def signed_carol_bicycle_transaction(request, carol_keypair,
310304

311305

312306
@fixture
313-
@await_transaction
314307
def persisted_carol_bicycle_transaction(transactions_api_full_url,
315308
signed_carol_bicycle_transaction):
316309
response = requests.post(

tests/test_driver.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@ def test_driver_init(self, nodes, headers, normalized_nodes):
3434
assert driver.transactions
3535
assert driver.outputs
3636

37-
def test_info(self, driver, bdb_node_pubkey):
37+
def test_info(self, driver):
3838
response = driver.info()
3939
assert 'api' in response
4040
assert 'docs' in response
4141
assert response['keyring'] == []
42-
# TODO: update when server exposes public key
43-
# assert response['public_key'] == bdb_node_pubkey
4442
assert response['software'] == 'BigchainDB'
4543
assert 'version' in response
4644

@@ -146,9 +144,9 @@ def test_get_empty(self, driver, query_params):
146144
response = driver.transactions.get(asset_id='a' * 64)
147145
assert response == []
148146

149-
@mark.parametrize('operation,tx_qty', (
147+
@mark.parametrize('operation,tx_qty', [
150148
(None, 3), ('CREATE', 1), ('TRANSFER', 2)
151-
))
149+
])
152150
@mark.usefixtures('persisted_transfer_dimi_car_to_ewy')
153151
def test_get(self, driver,
154152
signed_carol_car_transaction, operation, tx_qty):

0 commit comments

Comments
 (0)