Skip to content

Commit b446a59

Browse files
committed
Revert "Fix broken test cases by adding an is_empty function"
This reverts commit 4eb5727.
1 parent 64a9a01 commit b446a59

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

aikido_zen/background_process/cloud_connection_manager/update_firewall_lists_test.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,17 @@ def test_update_firewall_lists_no_token(connection_manager):
141141
connection_manager.token = None
142142
update_firewall_lists(connection_manager)
143143
# No changes should be made, so we check the initial state
144-
assert connection_manager.conf.bypassed_ips.is_empty()
144+
assert len(connection_manager.conf.bypassed_ips.blocked_subnets) == 0
145+
assert len(connection_manager.conf.bypassed_ips.blocked_addresses) == 0
145146

146147

147148
def test_update_firewall_lists_serverless(connection_manager):
148149
# Set serverless to True
149150
connection_manager.serverless = True
150151
update_firewall_lists(connection_manager)
151152
# No changes should be made, so we check the initial state
152-
assert connection_manager.conf.bypassed_ips.is_empty()
153+
assert len(connection_manager.conf.bypassed_ips.blocked_subnets) == 0
154+
assert len(connection_manager.conf.bypassed_ips.blocked_addresses) == 0
153155

154156

155157
def test_update_firewall_lists_api_failure(connection_manager):
@@ -161,7 +163,8 @@ def fetch_firewall_lists(self, token):
161163
connection_manager.api = FailingApi()
162164
update_firewall_lists(connection_manager)
163165
# No changes should be made, so we check the initial state
164-
assert connection_manager.conf.bypassed_ips.is_empty()
166+
assert len(connection_manager.conf.bypassed_ips.blocked_subnets) == 0
167+
assert len(connection_manager.conf.bypassed_ips.blocked_addresses) == 0
165168

166169

167170
def test_update_firewall_lists_exception_handling(connection_manager):
@@ -173,4 +176,5 @@ def fetch_firewall_lists(self, token):
173176
connection_manager.api = ExceptionApi()
174177
update_firewall_lists(connection_manager)
175178
# No changes should be made, so we check the initial state
176-
assert connection_manager.conf.bypassed_ips.is_empty()
179+
assert len(connection_manager.conf.bypassed_ips.blocked_subnets) == 0
180+
assert len(connection_manager.conf.bypassed_ips.blocked_addresses) == 0

aikido_zen/helpers/ip_matcher/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,3 @@ def add(self, network):
4242
return self
4343
self.sorted.insert(idx, net)
4444
return self
45-
46-
def is_empty(self):
47-
return len(self.sorted) == 0

0 commit comments

Comments
 (0)