Skip to content

Instantly share code, notes, and snippets.

@feuGeneA
Created March 26, 2019 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save feuGeneA/e0ff32549c2b60f0494195653a23977f to your computer and use it in GitHub Desktop.
Save feuGeneA/e0ff32549c2b60f0494195653a23977f to your computer and use it in GitHub Desktop.
26Mar18:51:52 rc=1 [2 jobs] ~/dev/0x-monorepo-michaelhly/python-packages/sra_client[feature/python/new-python-demos $%=]$ ./setup.py test
running test
running egg_info
writing 0x_sra_client.egg-info/PKG-INFO
writing dependency_links to 0x_sra_client.egg-info/dependency_links.txt
writing requirements to 0x_sra_client.egg-info/requires.txt
writing top-level names to 0x_sra_client.egg-info/top_level.txt
reading manifest file '0x_sra_client.egg-info/SOURCES.txt'
writing manifest file '0x_sra_client.egg-info/SOURCES.txt'
running build_ext
======================================================================================== test session starts ========================================================================================
platform linux -- Python 3.7.2, pytest-3.10.1, py-1.7.0, pluggy-0.8.1
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/gene/dev/0x-monorepo-michaelhly/python-packages/sra_client/.hypothesis/examples')
rootdir: /home/gene/dev/0x-monorepo-michaelhly/python-packages/sra_client, inifile:
plugins: xdist-1.26.1, pythonpath-0.7.3, mock-1.10.0, forked-1.0.1, hypothesis-4.4.1, flaky-3.5.3
collected 16 items
sra_client/__init__.py F [ 6%]
sra_client/api/default_api.py ssssssssssssss [ 93%]
test/test_default_api.py F [100%]
============================================================================================= FAILURES ==============================================================================================
_______________________________________________________________________________________ [doctest] sra_client ________________________________________________________________________________________
095 ... provider, Web3.toChecksumAddress(maker_address), order_hash)
096 >>> relayer_api.post_order_with_http_info(
097 ... network_id=50, signed_order_schema=example_order)[1]
098 200
099
100 Get Orders
101 -----------
102 Get orders from an SRA-compliant Relayer.
103
104 >>> relayer_api.get_orders()
Differences (unified diff with -expected +actual):
@@ -1,3 +1,17 @@
{'records': [{'meta_data': {},
+ 'order': {'exchange_address': '0x35dd2932454449b14cee11a94d3674a936d5d7b2',
+ 'expiration_time_seconds': '1000000000000000000000',
+ 'fee_recipient_address': '0x0000000000000000000000000000000000000000',
+ 'maker_address': '0x5409ed021d9299bf6814279a6a1411a7e866a631',
+ 'maker_asset_amount': '1000000000000000000',
+ 'maker_asset_data': '0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c',
+ 'maker_fee': '0',
+ 'salt': '2362734632784682376287462',
+ 'sender_address': '0x0000000000000000000000000000000000000000',
+ 'taker_address': '0x0000000000000000000000000000000000000000',
+ 'taker_asset_amount': '500000000000000000000',
+ 'taker_asset_data': '0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa',
+ 'taker_fee': '0'}},
+ {'meta_data': {},
'order': {'exchange_address': '0x48bacb9266a570d521063ef5dd96e61686dbe788',
'expiration_time_seconds': '1000000000000000000000',
/home/gene/dev/0x-monorepo-michaelhly/python-packages/sra_client/sra_client/__init__.py:104: DocTestFailure
________________________________________________________________________________ TestDefaultApi.test_get_asset_pairs ________________________________________________________________________________
self = <test.test_default_api.TestDefaultApi testMethod=test_get_asset_pairs>
def test_get_asset_pairs(self):
"""Test case for get_asset_pairs
"""
expected = {
"records": [
{
"assetDataA": {
"assetData": "0xf47261b00000000000000000000000000"
"b1ba0af832d7c05fd64161e0db78e85978e8082",
"maxAmount": "115792089237316195423570985008687907853"
"269984665640564039457584007913129639936",
"minAmount": "0",
"precision": 18,
},
"assetDataB": {
"assetData": "0xf47261b0000000000000000000000000"
"871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c",
"maxAmount": "115792089237316195423570985008687907853"
"269984665640564039457584007913129639936",
"minAmount": "0",
"precision": 18,
},
}
]
}
actual = self.api.get_asset_pairs()
acutal_asset_data_a = actual.records[0]["assetDataA"]["assetData"]
expected_asset_data_a = expected["records"][0]["assetDataA"][
"assetData"
]
> self.assertEqual(acutal_asset_data_a, expected_asset_data_a)
E AssertionError: '0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c' != '0xf47261b00000000000000000000000000b1ba0af832d7c05fd64161e0db78e85978e8082'
E - 0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c
E + 0xf47261b00000000000000000000000000b1ba0af832d7c05fd64161e0db78e85978e8082
test/test_default_api.py:58: AssertionError
===Flaky Test Report===
===End Flaky Test Report===
========================================================================================= warnings summary ==========================================================================================
sra_client/__init__.py::sra_client
/home/gene/.pythonz/pythons/CPython-3.7.2/lib/python3.7/site-packages/eth_account/account.py:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import (
/home/gene/.pythonz/pythons/CPython-3.7.2/lib/python3.7/site-packages/eth_keys/datatypes.py:107: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
class BaseKey(ByteString, collections.Hashable):
/home/gene/.pythonz/pythons/CPython-3.7.2/lib/python3.7/site-packages/attrdict/mixins.py:5: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import Mapping, MutableMapping, Sequence
/home/gene/.pythonz/pythons/CPython-3.7.2/lib/python3.7/site-packages/attrdict/mixins.py:5: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import Mapping, MutableMapping, Sequence
/home/gene/.pythonz/pythons/CPython-3.7.2/lib/python3.7/site-packages/rlp/lazy.py:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import Iterable, Sequence
/home/gene/dev/0x-web3.py/web3/utils/six/six.py:7: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
Generator = collections.Generator
/home/gene/.pythonz/pythons/CPython-3.7.2/lib/python3.7/site-packages/eth_utils/applicators.py:32: DeprecationWarning: combine_argument_formatters(formatter1, formatter2)([item1, item2])has been deprecated and will be removed in a subsequent major version release of the eth-utils library. Update your calls to use apply_formatters_to_sequence([formatter1, formatter2], [item1, item2]) instead.
"combine_argument_formatters(formatter1, formatter2)([item1, item2])"
/home/gene/dev/0x-web3.py/web3/utils/decorators.py:14: DeprecationWarning: call is deprecated in favor of contract.<functions/events>.<method name>.call
return self.method(obj, *args, **kwargs)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
========================================================================= 2 failed, 14 skipped, 8 warnings in 1.25 seconds =========================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment