def check_get_etc(output_fields): """ Checks whether the price of etc is a float and larger than zero. """ etc_price = output_fields[CRYPTO_PRICE_FLD] check_float_value(etc_price, CRYPTO_PRICE_FLD)
def check_get_btc(output_fields): """ Checks whether the price of btc is a float and larger than zero. """ btc_price = output_fields[BTC_PRICE_FLD] check_float_value(btc_price, BTC_PRICE_FLD)
def check_iterate(out_fields): """ Collects the last price from the output fields and checks whether it is a float larger than zero. """ last_price = out_fields[LAST_PRICE_FLD] check_float_value(last_price, LAST_PRICE_FLD)
def check_change(output_fields): """ Test ChangeCurrency operation. Expects: Ok response Price of bitcoin in EUR as float """ btc_price = output_fields[BTC_PRICE_FLD] check_float_value(btc_price, BTC_PRICE_FLD)
def check_compare_decrease(out_fields): """ Collects the percentage change fom the output fields, checks whether it is a float, rounds it and checks it against a reference value. """ change = out_fields[CHANGE_FLD] expected_change = -25.00 check_compare(change, expected_change) check_float_value(change, CHANGE_FLD)