mirror of
https://github.com/planetmint/planetmint.git
synced 2025-07-03 11:12:30 +00:00
fixed testing issue/migration
This commit is contained in:
parent
d272b13179
commit
e3ce86b9a5
@ -24,8 +24,8 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
# For this test case we import and use the Python Driver.
|
# For this test case we import and use the Python Driver.
|
||||||
from bigchaindb_driver import BigchainDB
|
from planetmint_driver import planetmint
|
||||||
from bigchaindb_driver.crypto import generate_keypair
|
from planetmint_driver.crypto import generate_keypair
|
||||||
|
|
||||||
|
|
||||||
def test_basic():
|
def test_basic():
|
||||||
@ -34,7 +34,7 @@ def test_basic():
|
|||||||
# connect to localhost, but you can override this value using the env variable
|
# connect to localhost, but you can override this value using the env variable
|
||||||
# called `PLANETMINT_ENDPOINT`, a valid value must include the schema:
|
# called `PLANETMINT_ENDPOINT`, a valid value must include the schema:
|
||||||
# `https://example.com:9984`
|
# `https://example.com:9984`
|
||||||
bdb = BigchainDB(os.environ.get('PLANETMINT_ENDPOINT'))
|
bdb = Planetmint(os.environ.get('PLANETMINT_ENDPOINT'))
|
||||||
|
|
||||||
# ## Create keypairs
|
# ## Create keypairs
|
||||||
# This test requires the interaction between two actors with their own keypair.
|
# This test requires the interaction between two actors with their own keypair.
|
||||||
|
@ -26,18 +26,18 @@
|
|||||||
# And of course, we also need the `BadRequest`.
|
# And of course, we also need the `BadRequest`.
|
||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
from bigchaindb_driver.exceptions import BadRequest
|
from planetmint_driver.exceptions import BadRequest
|
||||||
|
|
||||||
# For this test case we import and use the Python Driver.
|
# For this test case we import and use the Python Driver.
|
||||||
from bigchaindb_driver import BigchainDB
|
from planetmint_driver import planetmint
|
||||||
from bigchaindb_driver.crypto import generate_keypair
|
from planetmint_driver.crypto import generate_keypair
|
||||||
|
|
||||||
|
|
||||||
def test_divisible_assets():
|
def test_divisible_assets():
|
||||||
# ## Set up a connection to Planetmint
|
# ## Set up a connection to Planetmint
|
||||||
# Check [test_basic.py](./test_basic.html) to get some more details
|
# Check [test_basic.py](./test_basic.html) to get some more details
|
||||||
# about the endpoint.
|
# about the endpoint.
|
||||||
bdb = BigchainDB(os.environ.get('PLANETMINT_ENDPOINT'))
|
bdb = Planetmint(os.environ.get('PLANETMINT_ENDPOINT'))
|
||||||
|
|
||||||
# Oh look, it is Alice again and she brought her friend Bob along.
|
# Oh look, it is Alice again and she brought her friend Bob along.
|
||||||
alice, bob = generate_keypair(), generate_keypair()
|
alice, bob = generate_keypair(), generate_keypair()
|
||||||
|
@ -11,13 +11,13 @@ from uuid import uuid4
|
|||||||
from threading import Thread
|
from threading import Thread
|
||||||
import queue
|
import queue
|
||||||
|
|
||||||
import bigchaindb_driver.exceptions
|
import planetmint_driver.exceptions
|
||||||
from bigchaindb_driver import BigchainDB
|
from planetmint_driver import planetmint
|
||||||
from bigchaindb_driver.crypto import generate_keypair
|
from planetmint_driver.crypto import generate_keypair
|
||||||
|
|
||||||
|
|
||||||
def test_double_create():
|
def test_double_create():
|
||||||
bdb = BigchainDB(os.environ.get('PLANETMINT_ENDPOINT'))
|
bdb = Planetmint(os.environ.get('PLANETMINT_ENDPOINT'))
|
||||||
alice = generate_keypair()
|
alice = generate_keypair()
|
||||||
|
|
||||||
results = queue.Queue()
|
results = queue.Queue()
|
||||||
@ -33,7 +33,7 @@ def test_double_create():
|
|||||||
try:
|
try:
|
||||||
bdb.transactions.send_commit(tx)
|
bdb.transactions.send_commit(tx)
|
||||||
results.put('OK')
|
results.put('OK')
|
||||||
except bigchaindb_driver.exceptions.TransportError as e:
|
except planetmint_driver.exceptions.TransportError as e:
|
||||||
results.put('FAIL')
|
results.put('FAIL')
|
||||||
|
|
||||||
t1 = Thread(target=send_and_queue, args=(tx, ))
|
t1 = Thread(target=send_and_queue, args=(tx, ))
|
||||||
|
@ -25,15 +25,15 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
# For this test case we import and use the Python Driver.
|
# For this test case we import and use the Python Driver.
|
||||||
from bigchaindb_driver import BigchainDB
|
from planetmint_driver import planetmint
|
||||||
from bigchaindb_driver.crypto import generate_keypair
|
from planetmint_driver.crypto import generate_keypair
|
||||||
|
|
||||||
|
|
||||||
def test_multiple_owners():
|
def test_multiple_owners():
|
||||||
# ## Set up a connection to Planetmint
|
# ## Set up a connection to Planetmint
|
||||||
# Check [test_basic.py](./test_basic.html) to get some more details
|
# Check [test_basic.py](./test_basic.html) to get some more details
|
||||||
# about the endpoint.
|
# about the endpoint.
|
||||||
bdb = BigchainDB(os.environ.get('PLANETMINT_ENDPOINT'))
|
bdb = Planetmint(os.environ.get('PLANETMINT_ENDPOINT'))
|
||||||
|
|
||||||
# Hey Alice and Bob, nice to see you again!
|
# Hey Alice and Bob, nice to see you again!
|
||||||
alice, bob = generate_keypair(), generate_keypair()
|
alice, bob = generate_keypair(), generate_keypair()
|
||||||
|
@ -24,9 +24,9 @@ from blns import blns
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
# For this test case we import and use the Python Driver.
|
# For this test case we import and use the Python Driver.
|
||||||
from bigchaindb_driver import BigchainDB
|
from planetmint_driver import planetmint
|
||||||
from bigchaindb_driver.crypto import generate_keypair
|
from planetmint_driver.crypto import generate_keypair
|
||||||
from bigchaindb_driver.exceptions import BadRequest
|
from planetmint_driver.exceptions import BadRequest
|
||||||
|
|
||||||
naughty_strings = blns.all()
|
naughty_strings = blns.all()
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ def send_naughty_tx(asset, metadata):
|
|||||||
# ## Set up a connection to Planetmint
|
# ## Set up a connection to Planetmint
|
||||||
# Check [test_basic.py](./test_basic.html) to get some more details
|
# Check [test_basic.py](./test_basic.html) to get some more details
|
||||||
# about the endpoint.
|
# about the endpoint.
|
||||||
bdb = BigchainDB(os.environ.get('PLANETMINT_ENDPOINT'))
|
bdb = Planetmint(os.environ.get('PLANETMINT_ENDPOINT'))
|
||||||
|
|
||||||
# Here's Alice.
|
# Here's Alice.
|
||||||
alice = generate_keypair()
|
alice = generate_keypair()
|
||||||
|
@ -27,8 +27,8 @@ from uuid import uuid4
|
|||||||
# [websocket](https://github.com/websocket-client/websocket-client) module
|
# [websocket](https://github.com/websocket-client/websocket-client) module
|
||||||
from websocket import create_connection
|
from websocket import create_connection
|
||||||
|
|
||||||
from bigchaindb_driver import BigchainDB
|
from planetmint_driver import planetmint
|
||||||
from bigchaindb_driver.crypto import generate_keypair
|
from planetmint_driver.crypto import generate_keypair
|
||||||
|
|
||||||
|
|
||||||
def test_stream():
|
def test_stream():
|
||||||
@ -40,7 +40,7 @@ def test_stream():
|
|||||||
# *That's pretty bad, but let's do like this for now.*
|
# *That's pretty bad, but let's do like this for now.*
|
||||||
WS_ENDPOINT = 'ws://{}:9985/api/v1/streams/valid_transactions'.format(BDB_ENDPOINT.rsplit(':')[0])
|
WS_ENDPOINT = 'ws://{}:9985/api/v1/streams/valid_transactions'.format(BDB_ENDPOINT.rsplit(':')[0])
|
||||||
|
|
||||||
bdb = BigchainDB(BDB_ENDPOINT)
|
bdb = Planetmint(BDB_ENDPOINT)
|
||||||
|
|
||||||
# Hello to Alice again, she is pretty active in those tests, good job
|
# Hello to Alice again, she is pretty active in those tests, good job
|
||||||
# Alice!
|
# Alice!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user