def test_get_total_value_one_currency(): response = get_total_value( {'GBP': { 'currency_symbol': '£', 'total_amount': 257947 }}) assert response == ['£ 257,947']
def test_get_total_value_total_amount_key_missing(): data_by_currency = { 'GBP': { 'currency_symbol': '£' }, 'CHP': { 'currency_symbol': '', 'total_amount': 234.898000 } } response = get_total_value(data_by_currency) assert response == ['CHP 235']
def test_get_total_value_multiple_currencies(): data_by_currency = { 'GBP': { 'currency_symbol': '£', 'total_amount': 257947 }, 'CHP': { 'currency_symbol': '', 'total_amount': 234.898000 } } response = get_total_value(data_by_currency) assert response == ['£ 257,947', 'CHP 235']
def test_get_total_value_total_amount_empty_string(): data_by_currency = { 'GBP': { 'currency_symbol': '£', 'total_amount': 257947 }, 'CHP': { 'currency_symbol': '', 'total_amount': '' } } response = get_total_value(data_by_currency) assert response == ['£ 257,947']
def test_get_total_value_rounded_value(): response = get_total_value({'GBP': {'total_amount': 257947.49}}) assert response == ['GBP 257,947']
def test_get_total_value_currency_symbol_key_missing(): response = get_total_value({'GBP': {'total_amount': 257947}}) assert response == ['GBP 257,947']
def test_get_total_value_empty_dict(): response = get_total_value({}) assert response == []