diff --git a/src/pyejabberd/client.py b/src/pyejabberd/client.py index e8794be..bc2e37c 100644 --- a/src/pyejabberd/client.py +++ b/src/pyejabberd/client.py @@ -47,7 +47,7 @@ def __init__(self, host, port, username, password, user_domain, protocol=None, v self._proxy = None @staticmethod - def from_string(service_url, verbose=False): + def get_instance(service_url, verbose=False): """ Returns a EjabberdAPIClient instance based on a '12factor app' compliant service_url diff --git a/tests/test_pyejabberd.py b/tests/test_pyejabberd.py index cc0c9a5..71b1a3b 100644 --- a/tests/test_pyejabberd.py +++ b/tests/test_pyejabberd.py @@ -37,7 +37,7 @@ def test_from_string_ok(self): api = None error_thrown = False try: - api = EjabberdAPIClient.from_string(service_url) + api = EjabberdAPIClient.get_instance(service_url) except AssertionError: error_thrown = True self.assertFalse(error_thrown) @@ -49,7 +49,7 @@ def test_from_string_incorrect_protocol(self): api = None error_thrown = False try: - api = EjabberdAPIClient.from_string(service_url) + api = EjabberdAPIClient.get_instance(service_url) except AssertionError: error_thrown = True self.assertTrue(error_thrown) @@ -61,7 +61,7 @@ def test_from_string_incorrect_auth(self): api = None error_thrown = False try: - api = EjabberdAPIClient.from_string(service_url) + api = EjabberdAPIClient.get_instance(service_url) except AssertionError: error_thrown = True self.assertTrue(error_thrown) @@ -73,7 +73,7 @@ def test_from_string_default_server_port(self): api = None error_thrown = False try: - api = EjabberdAPIClient.from_string(service_url) + api = EjabberdAPIClient.get_instance(service_url) except AssertionError: error_thrown = True self.assertFalse(error_thrown) @@ -87,7 +87,7 @@ def test_from_string_incorrect_server(self): api = None error_thrown = False try: - api = EjabberdAPIClient.from_string(service_url) + api = EjabberdAPIClient.get_instance(service_url) except AssertionError: error_thrown = True self.assertTrue(error_thrown) @@ -100,7 +100,7 @@ def test_from_string_incorrect_domain(self): api = None error_thrown = False try: - api = EjabberdAPIClient.from_string(service_url) + api = EjabberdAPIClient.get_instance(service_url) except AssertionError: error_thrown = True self.assertTrue(error_thrown)