Unit Tests

Privex Golos-Python Unit Tests

To run these tests:

pip3 install -r requirements.txt
pytest -v tests.py

Enabling extra logging output:

If you want to see the logging output of the library, use the DEBUG environment variable, and execute tests.py directly (not via pytest, as pytest will filter out the log messages):

DEBUG=true ./tests.py -vv

Copyright:

+===================================================+
|                 © 2019 Privex Inc.                |
|               https://www.privex.io               |
+===================================================+
|                                                   |
|        Privex's Golos Library                     |
|        License: X11/MIT                           |
|                                                   |
|        Core Developer(s):                         |
|                                                   |
|          (+)  Chris (@someguy123) [Privex]        |
|                                                   |
+===================================================+

Privex's Golos Python Library
Copyright (c) 2019    Privex Inc. ( https://www.privex.io )

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Classes

GolosTestCase([methodName])

class tests.GolosKeyTests(methodName='runTest')[source]
test_account_keys()[source]

Test Key.get_keys correctly generates account public/private keys

test_compare_keys()[source]

Test that Key.is_key correctly verifies a public key matches a private key

test_get_public()[source]

Test Key.get_public_from_private returns the correct public key

class tests.GolosTestCase(methodName='runTest')[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_find_tx()[source]

Test Api.find_op_transaction returns the correct transaction from an operation

test_find_tx_no_exist()[source]

Test Api.find_op_transaction raises TransactionNotFound with a non-existent operation

test_get_account()[source]

Testing Api.get_accounts returns valid account dictionaries

test_get_account_history()[source]

Testing Api.get_account_history returns a non-empty list containing valid history items

test_get_transaction()[source]

Test Api.get_transaction returns the correct transaction from a TXID

test_get_transaction_id()[source]

Test Api.get_transaction_id generates the correct TXID from a transaction dict

test_get_transaction_no_exist()[source]

Test Api.get_transaction raises TransactionNotFound with a non-existent TXID

test_get_witness()[source]

Testing Api.get_witness returns a valid witness info dictionary