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,
        )
Exemple #2
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,
        )