Skip to content

Commit

Permalink
Renamed EjabberdAPIClient.from_string to EjabberdAPIClient.get_instance
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmoors committed Jul 14, 2015
1 parent 803c9bf commit 66fd8da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/pyejabberd/client.py
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions tests/test_pyejabberd.py
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 66fd8da

Please sign in to comment.