def test_custom_date(r_symbol): s_date = random_date() a = get_normal_currency(date=s_date, symbols=r_symbol) assert a.get('success') == True assert a.get('base') == 'EUR' #assert correct base rates = a.get('rates') assert len(list(rates.values())) == 1 #assert symbol is requested symbol assert rates.get(r_symbol, '') != '' #assert date is requested date r_date = a.get('date') assert r_date == s_date #assert date is requested date
def test_custom_empty_access_key_value(): base, date, symbols, key = ['EUR', random_date(), 'USD', ''] a = custom_api(base, date, symbols, key) assert a.get('success') == False assert a.get('rates', '') == ''
def test_custom_no_access_key_parameter(): base, date, symbols, key = ['EUR', random_date(), 'USD', None] a = custom_api(base, date, symbols, key) assert a.get('success') == False assert a.get('rates', '') == ''
def test_two_date_values(): two_dates = random_date() + " " + random_date() base, date, symbols, key = ['EUR', two_dates, 'USD', api_key] a = custom_api(base, date, symbols, key) assert a.get('success') == False