예제 #1
0
    def test_number_country(self, request):
        resp = create_mock_json('tests/resources/pricing/phone_number_country_instance.json')
        resp.status_code = 200
        request.return_value = resp

        countries = PhoneNumberCountries(BASE_URI + "/PhoneNumbers", AUTH)
        country = countries.get('EE')

        assert_equal(country.country, "Estonia")
        assert_equal(
            country.phone_number_prices,
            [
                {
                    'type': 'mobile',
                    'base_price': 3.00,
                    'current_price': 3.00,
                },
                {
                    'type': 'national',
                    'base_price': 1.00,
                    'current_price': 1.00,
                }
            ],
        )

        request.assert_called_with(
            "GET",
            "{0}/PhoneNumbers/Countries/EE".format(BASE_URI),
            auth=AUTH,
            use_json_extension=False,
        )
예제 #2
0
    def test_number_country(self, request):
        resp = create_mock_json(
            'tests/resources/pricing/phone_number_country_instance.json')
        resp.status_code = 200
        request.return_value = resp

        countries = PhoneNumberCountries(BASE_URI + "/PhoneNumbers", AUTH)
        country = countries.get('EE')

        assert_equal(country.country, "Estonia")
        assert_equal(
            country.phone_number_prices,
            [{
                'type': 'mobile',
                'base_price': 3.00,
                'current_price': 3.00,
            }, {
                'type': 'national',
                'base_price': 1.00,
                'current_price': 1.00,
            }],
        )

        request.assert_called_with(
            "GET",
            "{0}/PhoneNumbers/Countries/EE".format(BASE_URI),
            auth=AUTH,
            use_json_extension=False,
        )
예제 #3
0
    def test_number_countries(self, request):
        resp = create_mock_json('tests/resources/pricing/phone_number_country_list.json')
        resp.status_code = 200
        request.return_value = resp

        countries = PhoneNumberCountries(BASE_URI + "/PhoneNumbers", AUTH)
        result = countries.list()

        assert_equal(result[0].iso_country, "AC")
        assert_equal(len(result), 3)

        request.assert_called_with(
            "GET",
            "{0}/PhoneNumbers/Countries".format(BASE_URI),
            auth=AUTH,
            use_json_extension=False,
        )
예제 #4
0
    def test_number_countries(self, request):
        resp = create_mock_json(
            'tests/resources/pricing/phone_number_country_list.json')
        resp.status_code = 200
        request.return_value = resp

        countries = PhoneNumberCountries(BASE_URI + "/PhoneNumbers", AUTH)
        result = countries.list()

        assert_equal(result[0].iso_country, "AC")
        assert_equal(len(result), 3)

        request.assert_called_with(
            "GET",
            "{0}/PhoneNumbers/Countries".format(BASE_URI),
            auth=AUTH,
            use_json_extension=False,
        )