From c74500c00769bea21e57899f4663bf39f1aadda4 Mon Sep 17 00:00:00 2001 From: Jon Mahoney Date: Mon, 25 Jan 2021 22:14:13 +0000 Subject: [PATCH] Remove server forwarding rule reference --- mailosaur/models/__init__.py | 2 -- mailosaur/models/forwarding_rule.py | 22 ---------------------- mailosaur/models/server.py | 6 ------ tests/servers_test.py | 3 --- 4 files changed, 33 deletions(-) delete mode 100644 mailosaur/models/forwarding_rule.py diff --git a/mailosaur/models/__init__.py b/mailosaur/models/__init__.py index 4f23143..c5f65d6 100644 --- a/mailosaur/models/__init__.py +++ b/mailosaur/models/__init__.py @@ -13,7 +13,6 @@ from .message_summary import MessageSummary from .message_list_result import MessageListResult from .search_criteria import SearchCriteria -from .forwarding_rule import ForwardingRule from .server import Server from .server_list_result import ServerListResult from .server_create_options import ServerCreateOptions @@ -34,7 +33,6 @@ 'MessageSummary', 'MessageListResult', 'SearchCriteria', - 'ForwardingRule', 'Server', 'ServerListResult', 'ServerCreateOptions', diff --git a/mailosaur/models/forwarding_rule.py b/mailosaur/models/forwarding_rule.py deleted file mode 100644 index ce44d0c..0000000 --- a/mailosaur/models/forwarding_rule.py +++ /dev/null @@ -1,22 +0,0 @@ -class ForwardingRule(object): - """ForwardingRule. - - :param field: Possible values include: 'from', 'to', 'subject' - :type field: str or ~mailosaur.models.enum - :param operator: Possible values include: 'endsWith', 'startsWith', - 'contains' - :type operator: str or ~mailosaur.models.enum - :param value: - :type value: str - :param forward_to: - :type forward_to: str - """ - - def __init__(self, data=None): - if data is None: - data = {} - - self.field = data.get('field', None) - self.operator = data.get('operator', None) - self.value = data.get('value', None) - self.forward_to = data.get('forward_to', None) diff --git a/mailosaur/models/server.py b/mailosaur/models/server.py index 5368c39..54280b1 100644 --- a/mailosaur/models/server.py +++ b/mailosaur/models/server.py @@ -1,5 +1,3 @@ -from .forwarding_rule import ForwardingRule - class Server(object): """Server. @@ -15,9 +13,6 @@ class Server(object): :type users: list[str] :param messages: The number of messages currently in the server. :type messages: int - :param forwarding_rules: The rules used to manage email forwarding for - this server. - :type forwarding_rules: list[~mailosaur.models.ForwardingRule] """ def __init__(self, data=None): @@ -29,4 +24,3 @@ def __init__(self, data=None): self.name = data.get('name', None) self.users = data.get('users', None) self.messages = data.get('messages', None) - self.forwarding_rules = [ForwardingRule(i) for i in data.get('forwardingRules', [])] diff --git a/tests/servers_test.py b/tests/servers_test.py index 37ba10f..76381ac 100644 --- a/tests/servers_test.py +++ b/tests/servers_test.py @@ -34,7 +34,6 @@ def test_crud(self): self.assertIsNotNone(created_server.password) self.assertIsInstance(created_server.users, list) self.assertIsInstance(created_server.messages, numbers.Number) - self.assertIsInstance(created_server.forwarding_rules, list) # Retrieve a server and confirm it has expected content retrieved_server = self.client.servers.get(created_server.id) @@ -43,7 +42,6 @@ def test_crud(self): self.assertIsNotNone(retrieved_server.password) self.assertIsInstance(retrieved_server.users, list) self.assertIsInstance(retrieved_server.messages, numbers.Number) - self.assertIsInstance(retrieved_server.forwarding_rules, list) # Update a server and confirm it has changed retrieved_server.name += " updated with ellipsis … and emoji 👨🏿‍🚒" @@ -53,7 +51,6 @@ def test_crud(self): self.assertEqual(retrieved_server.password, updated_server.password) self.assertEqual(retrieved_server.users, updated_server.users) self.assertEqual(retrieved_server.messages, updated_server.messages) - self.assertEqual(retrieved_server.forwarding_rules, updated_server.forwarding_rules) self.client.servers.delete(retrieved_server.id)