def test_voice_country(self, request): resp = create_mock_json( 'tests/resources/pricing/voice_country_instance.json') resp.status_code = 200 request.return_value = resp countries = VoiceCountries(BASE_URI + "/Voice", AUTH) country = countries.get('EE') assert_equal(country.country, "Estonia") assert_equal( country.inbound_call_prices[0], { 'number_type': 'mobile', 'call_base_price': 0.0075, 'call_current_price': 0.0070 }, ) request.assert_called_with( "GET", "{0}/Voice/Countries/EE".format(BASE_URI), auth=AUTH, use_json_extension=False, )
def test_voice_countries(self, request): resp = create_mock_json('tests/resources/pricing/voice_countries_list.json') resp.status_code = 200 request.return_value = resp countries = VoiceCountries(BASE_URI + "/Voice", AUTH) result = countries.list() assert_equal(result[0].iso_country, "AC") assert_equal(len(result), 3) request.assert_called_with( "GET", "{0}/Voice/Countries".format(BASE_URI), auth=AUTH, use_json_extension=False, )
def test_voice_countries(self, request): resp = create_mock_json( 'tests/resources/pricing/voice_countries_list.json') resp.status_code = 200 request.return_value = resp countries = VoiceCountries(BASE_URI + "/Voice", AUTH) result = countries.list() assert_equal(result[0].iso_country, "AC") assert_equal(len(result), 3) request.assert_called_with( "GET", "{0}/Voice/Countries".format(BASE_URI), auth=AUTH, use_json_extension=False, )
def test_voice_country(self, request): resp = create_mock_json('tests/resources/pricing/voice_country_instance.json') resp.status_code = 200 request.return_value = resp countries = VoiceCountries(BASE_URI + "/Voice", AUTH) country = countries.get('EE') assert_equal(country.country, "Estonia") assert_equal( country.inbound_call_prices[0], { 'number_type': 'mobile', 'call_base_price': 0.0075, 'call_current_price': 0.0070 }, ) request.assert_called_with( "GET", "{0}/Voice/Countries/EE".format(BASE_URI), auth=AUTH, use_json_extension=False, )