Skip to content

Commit 685588d

Browse files
committed
chore: pylint fixing
1 parent 021b486 commit 685588d

File tree

1 file changed

+44
-41
lines changed

1 file changed

+44
-41
lines changed

nau_openedx_extensions/enrollment_by_domain/tests/test_command.py

Lines changed: 44 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,16 @@ def test_is_valid_domain_with_invalid_domains(self):
164164

165165
def test_parse_domains_file_with_valid_content(self):
166166
"""Test parsing a file with valid domains."""
167-
content = """example.com
168-
test.edu
169-
# This is a comment
170-
university.org
167+
content = """
168+
example.com
169+
test.edu
170+
# This is a comment
171+
university.org
172+
173+
# Another comment
174+
subdomain.example.com
175+
"""
171176

172-
# Another comment
173-
subdomain.example.com
174-
"""
175-
176177
with patch('builtins.open', mock_open(read_data=content)):
177178
# pylint: disable=protected-access
178179
domains = self.command._parse_domains_file('fake_file.txt')
@@ -182,15 +183,16 @@ def test_parse_domains_file_with_valid_content(self):
182183

183184
def test_parse_domains_file_filters_invalid_domains(self):
184185
"""Test that invalid domains are filtered out and warnings are shown."""
185-
content = """example.com
186-
invalid domain with spaces
187-
.starts-with-dot.com
188-
test.edu
189-
ends-with-dot.
190-
just-text-no-dot
191-
valid-domain.org
192-
"""
193-
186+
content = """
187+
example.com
188+
invalid domain with spaces
189+
.starts-with-dot.com
190+
test.edu
191+
ends-with-dot.
192+
just-text-no-dot
193+
valid-domain.org
194+
"""
195+
194196
with patch('builtins.open', mock_open(read_data=content)):
195197
# pylint: disable=protected-access
196198
domains = self.command._parse_domains_file('fake_file.txt')
@@ -205,18 +207,18 @@ def test_parse_domains_file_filters_invalid_domains(self):
205207
def test_parse_domains_file_handles_empty_lines_and_comments(self):
206208
"""Test that empty lines and comments are properly ignored."""
207209
content = """
208-
# Header comment
209-
example.com
210+
# Header comment
211+
example.com
210212
211-
# Another comment
213+
# Another comment
214+
215+
test.edu
216+
# Indented comment
217+
university.org
218+
219+
# Final comment
220+
"""
212221

213-
test.edu
214-
# Indented comment
215-
university.org
216-
217-
# Final comment
218-
"""
219-
220222
with patch('builtins.open', mock_open(read_data=content)):
221223
# pylint: disable=protected-access
222224
domains = self.command._parse_domains_file('fake_file.txt')
@@ -226,12 +228,12 @@ def test_parse_domains_file_handles_empty_lines_and_comments(self):
226228

227229
def test_parse_domains_case_insensitive(self):
228230
"""Test that domains are converted to lowercase."""
229-
content = """EXAMPLE.COM
230-
Test.EDU
231-
UNIVERSITY.ORG
232-
MixedCase.Net
233-
"""
234-
231+
content = """
232+
EXAMPLE.COM
233+
Test.EDU
234+
UNIVERSITY.ORG
235+
MixedCase.Net
236+
"""
235237
with patch('builtins.open', mock_open(read_data=content)):
236238
# pylint: disable=protected-access
237239
domains = self.command._parse_domains_file('fake_file.txt')
@@ -241,14 +243,15 @@ def test_parse_domains_case_insensitive(self):
241243

242244
def test_parse_domains_removes_duplicates(self):
243245
"""Test that duplicate domains are removed."""
244-
content = """example.com
245-
test.edu
246-
example.com
247-
EXAMPLE.COM
248-
test.edu
249-
university.org
250-
"""
251-
246+
content = """
247+
example.com
248+
test.edu
249+
example.com
250+
EXAMPLE.COM
251+
test.edu
252+
university.org
253+
"""
254+
252255
with patch('builtins.open', mock_open(read_data=content)):
253256
# pylint: disable=protected-access
254257
domains = self.command._parse_domains_file('fake_file.txt')

0 commit comments

Comments
 (0)