mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Added localmongodb marker
This commit is contained in:
parent
6c3f176122
commit
fcfe577813
@ -3,7 +3,7 @@ from copy import deepcopy
|
|||||||
import pytest
|
import pytest
|
||||||
import pymongo
|
import pymongo
|
||||||
|
|
||||||
pytestmark = pytest.mark.tendermint
|
pytestmark = [pytest.mark.tendermint, pytest.mark.localmongodb]
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.bdb
|
@pytest.mark.bdb
|
||||||
@ -75,7 +75,6 @@ def test_get_assets():
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.bdb
|
@pytest.mark.bdb
|
||||||
@pytest.mark.tendermint
|
|
||||||
def test_text_search():
|
def test_text_search():
|
||||||
from ..mongodb.test_queries import test_text_search
|
from ..mongodb.test_queries import test_text_search
|
||||||
|
|
||||||
|
@ -25,6 +25,13 @@ USER_PRIVATE_KEY = '8eJ8q9ZQpReWyQT5aFCiwtZ5wDZC4eDnCen88p3tQ6ie'
|
|||||||
USER_PUBLIC_KEY = 'JEAkEJqLbbgDRAtMm8YAjGp759Aq2qTn9eaEHUj2XePE'
|
USER_PUBLIC_KEY = 'JEAkEJqLbbgDRAtMm8YAjGp759Aq2qTn9eaEHUj2XePE'
|
||||||
|
|
||||||
|
|
||||||
|
def pytest_runtest_setup(item):
|
||||||
|
if isinstance(item, item.Function):
|
||||||
|
backend = item.session.config.getoption('--database-backend')
|
||||||
|
if (item.get_marker('localmongodb') and backend != 'localmongodb'):
|
||||||
|
pytest.skip('Skip tendermint specific tests if not using localmongodb')
|
||||||
|
|
||||||
|
|
||||||
def pytest_addoption(parser):
|
def pytest_addoption(parser):
|
||||||
from bigchaindb.backend.connection import BACKENDS
|
from bigchaindb.backend.connection import BACKENDS
|
||||||
|
|
||||||
|
@ -87,11 +87,10 @@ def test_get_assets_limit(client, b):
|
|||||||
|
|
||||||
@pytest.mark.bdb
|
@pytest.mark.bdb
|
||||||
@pytest.mark.tendermint
|
@pytest.mark.tendermint
|
||||||
def test_get_assets_tmint(client, tb):
|
@pytest.mark.localmongodb
|
||||||
|
def test_get_assets_tendermint(client, tb):
|
||||||
from bigchaindb.models import Transaction
|
from bigchaindb.models import Transaction
|
||||||
from bigchaindb.backend.localmongodb.connection import LocalMongoDBConnection
|
|
||||||
|
|
||||||
if isinstance(tb.connection, LocalMongoDBConnection):
|
|
||||||
# test returns empty list when no assets are found
|
# test returns empty list when no assets are found
|
||||||
res = client.get(ASSETS_ENDPOINT + '?search=abc')
|
res = client.get(ASSETS_ENDPOINT + '?search=abc')
|
||||||
assert res.json == []
|
assert res.json == []
|
||||||
@ -116,12 +115,11 @@ def test_get_assets_tmint(client, tb):
|
|||||||
|
|
||||||
@pytest.mark.bdb
|
@pytest.mark.bdb
|
||||||
@pytest.mark.tendermint
|
@pytest.mark.tendermint
|
||||||
def test_get_assets_limit_tmint(client, tb):
|
@pytest.mark.localmongodb
|
||||||
|
def test_get_assets_limit_tendermint(client, tb):
|
||||||
from bigchaindb.models import Transaction
|
from bigchaindb.models import Transaction
|
||||||
from bigchaindb.backend.localmongodb.connection import LocalMongoDBConnection
|
|
||||||
|
|
||||||
b = tb
|
b = tb
|
||||||
if isinstance(b.connection, LocalMongoDBConnection):
|
|
||||||
# create two assets
|
# create two assets
|
||||||
asset1 = {'msg': 'abc 1'}
|
asset1 = {'msg': 'abc 1'}
|
||||||
asset2 = {'msg': 'abc 2'}
|
asset2 = {'msg': 'abc 2'}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user