Exemplo n.º 1
0
 def test_update_rename_status_callback_url(self):
     mock = Mock()
     mock.uri = "/base"
     instance = PhoneNumber(mock, "SID")
     instance.update(status_callback_url="http://www.example.com")
     mock.update.assert_called_with(
         "SID", status_callback="http://www.example.com")
Exemplo n.º 2
0
    def test_base_uri(self):
        parent = Mock()
        parent.base_uri = ("https://api.twilio.com/2010-04-01/Accounts/"
            "AC123")
        resource = PhoneNumber(parent, "PNd2ae06cced59a5733d2c1c1c69a83a28")

        with open("tests/resources/incoming_phone_numbers_instance.json") as f:
            entry = json.load(f)
            resource.load(entry)

        self.assertEquals(resource.parent.base_uri, 
            ("https://api.twilio.com/2010-04-01/Accounts/AC4bf2dafbed59a573"
             "3d2c1c1c69a83a28"))
Exemplo n.º 3
0
    def test_base_uri(self):
        parent = Mock()
        parent.base_uri = ("https://api.twilio.com/2010-04-01/Accounts/"
            "AC123")
        resource = PhoneNumber(parent, "PNd2ae06cced59a5733d2c1c1c69a83a28")

        with open("tests/resources/incoming_phone_numbers_instance.json") as f:
            entry = json.load(f)
            resource.load(entry)

        self.assertEquals(resource.parent.base_uri, 
            ("https://api.twilio.com/2010-04-01/Accounts/AC4bf2dafbed59a573"
             "3d2c1c1c69a83a28"))
Exemplo n.º 4
0
 def test_instance_transfer(self):
     mock = Mock()
     mock.uri = "/base"
     instance = PhoneNumber(mock, "SID")
     instance.transfer("AC123")
     mock.transfer.assert_called_with("SID", "AC123")
 def test_update_rename_status_callback_url(self):
     mock = Mock()
     mock.uri = "/base"
     instance = PhoneNumber(mock, "SID")
     instance.update(status_callback_url="http://www.example.com")
     mock.update.assert_called_with("SID", status_callback="http://www.example.com")
Exemplo n.º 6
0
 def test_instance_transfer(self):
     mock = Mock()
     mock.uri = "/base"
     instance = PhoneNumber(mock, "SID")
     instance.transfer("AC123")
     mock.transfer.assert_called_with("SID", "AC123")