mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Fixed tests.
Updated fixtures to flush the assets table after each test.
This commit is contained in:
parent
aacba571f8
commit
eb94181e1b
@ -1,3 +1,4 @@
|
||||
import pytest
|
||||
from pytest import raises
|
||||
|
||||
|
||||
@ -253,6 +254,7 @@ class TestBlockModel(object):
|
||||
asset_ids = Block.get_asset_ids(block_dict)
|
||||
assert asset_ids == [tx.id for tx in txs[:-1]]
|
||||
|
||||
@pytest.mark.bdb
|
||||
def test_from_db(self, b):
|
||||
from bigchaindb.models import Block, Transaction
|
||||
|
||||
|
@ -32,6 +32,7 @@ def flush_rethink_db(connection, dbname):
|
||||
connection.run(r.db(dbname).table('bigchain').delete())
|
||||
connection.run(r.db(dbname).table('backlog').delete())
|
||||
connection.run(r.db(dbname).table('votes').delete())
|
||||
connection.run(r.db(dbname).table('assets').delete())
|
||||
except r.ReqlOpFailedError:
|
||||
pass
|
||||
|
||||
@ -41,6 +42,7 @@ def flush_mongo_db(connection, dbname):
|
||||
connection.conn[dbname].bigchain.delete_many({})
|
||||
connection.conn[dbname].backlog.delete_many({})
|
||||
connection.conn[dbname].votes.delete_many({})
|
||||
connection.conn[dbname].assets.delete_many({})
|
||||
|
||||
|
||||
@singledispatch
|
||||
|
Loading…
x
Reference in New Issue
Block a user