diff --git a/tests/reference/coinmarketcap/v1/currentprice/bitcoin/EUR.json b/tests/reference/coinmarketcap/v1/currentprice/bitcoin/EUR.json new file mode 100644 index 0000000..7fedd10 --- /dev/null +++ b/tests/reference/coinmarketcap/v1/currentprice/bitcoin/EUR.json @@ -0,0 +1,21 @@ +[ + { + "id": "bitcoin", + "name": "Bitcoin", + "symbol": "BTC", + "rank": "1", + "price_usd": "1040.57", + "price_btc": "1.0", + "24h_volume_usd": "296801000.0", + "market_cap_usd": "16903031567.0", + "available_supply": "16244012.0", + "total_supply": "16244012.0", + "percent_change_1h": "-0.2", + "percent_change_24h": "-0.36", + "percent_change_7d": "0.36", + "last_updated": "1490827446", + "price_eur": "966.41690066", + "volume_eur": "275650367.138", + "market_cap_eur": "15698487731.0" + } +] \ No newline at end of file diff --git a/tests/test_endpoint.py b/tests/test_endpoint.py index 2e26c87..628683e 100644 --- a/tests/test_endpoint.py +++ b/tests/test_endpoint.py @@ -89,7 +89,15 @@ class BPITestCase(EndpointTest, TestCase): timestamp = datetime(2017, 3, 16, 1, 25, tzinfo=tzutc()) -class CoinmarketcapTestCase(EndpointTest, TestCase): +class BitstampTestCase(EndpointTest, TestCase): + endpointClass = bitstamp.Bitstamp + ref_json = 'bitstamp/v2/currentprice/bitcoin/USD.json' + + price = 1103.2 + timestamp = datetime(2017, 3, 17, 3, 45, 13, tzinfo=tzutc()) + + +class CoinmarketcapUSDTestCase(EndpointTest, TestCase): currency = 'USD' endpointClass = coinmarketcap.Coinmarketcap ref_json = 'coinmarketcap/v1/currentprice/bitcoin/USD.json' @@ -98,9 +106,10 @@ class CoinmarketcapTestCase(EndpointTest, TestCase): timestamp = datetime(2017, 3, 16, 0, 59, 26, tzinfo=tzutc()) -class BitstampTestCase(EndpointTest, TestCase): - endpointClass = bitstamp.Bitstamp - ref_json = 'bitstamp/v2/currentprice/bitcoin/USD.json' +class CoinmarketcapConversionTestCase(CoinmarketcapUSDTestCase): + currency = 'EUR' + currency_country = 'Euro' + ref_json = 'coinmarketcap/v1/currentprice/bitcoin/EUR.json' - price = 1103.2 - timestamp = datetime(2017, 3, 17, 3, 45, 13, tzinfo=tzutc()) + price = 966.41690066 + timestamp = datetime(2017, 3, 29, 22, 44, 6, tzinfo=tzutc())