aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_csv_reader.py
diff options
context:
space:
mode:
authordeepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>2025-02-14 13:47:05 +0000
committerGitHub <noreply@github.com>2025-02-14 13:47:05 +0000
commit0f29d52ba932eeed2ae5826c31cbe9a379fd4579 (patch)
treedfb7e6025607c503fb7e5e70abf0f8ba91e7e212 /test/test_csv_reader.py
parent6182930c3ea53932c6153dd101264cb90c90f979 (diff)
downloadgdpr-obfuscator-0f29d52ba932eeed2ae5826c31cbe9a379fd4579.tar.gz
gdpr-obfuscator-0f29d52ba932eeed2ae5826c31cbe9a379fd4579.zip
style: format code with Autopep8, Black and Ruff Formatter
This commit fixes the style issues introduced in 6182930 according to the output from Autopep8, Black and Ruff Formatter. Details: https://github.com/ajschofield/gdpr-obfuscator/pull/1
Diffstat (limited to 'test/test_csv_reader.py')
-rw-r--r--test/test_csv_reader.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/test_csv_reader.py b/test/test_csv_reader.py
index d245d7c..ac43b04 100644
--- a/test/test_csv_reader.py
+++ b/test/test_csv_reader.py
@@ -4,34 +4,38 @@
from main import csv_reader
import pytest
+
def test_empty_csv_should_return_no_content():
content = ""
result = csv_reader(content)
expected = []
assert result == expected
+
def test_csv_with_header_only_should_return_no_content():
content = "student_id,name,course\n"
result = csv_reader(content)
expected = []
assert result == expected
+
def test_csv_with_valid_data():
content = (
"student_id,name,course\n"
"1234,Student 1,Course 1\n"
"5678,Student 2,Course 2\n"
- )
+ )
result = csv_reader(content)
expected = [
{"student_id": "1234", "name": "Student 1", "course": "Course 1"},
{"student_id": "5678", "name": "Student 2", "course": "Course 2"},
- ]
- assert result == expected
+ ]
+ assert result == expected
+
def test_csv_with_quoted_fields_should_run_as_expected():
content = (
- 'student_id,name,course\n'
+ "student_id,name,course\n"
'1234,"Student 1","Course 1"\n'
'5678,"Student 2","Course 2"\n'
)
@@ -42,8 +46,9 @@ def test_csv_with_quoted_fields_should_run_as_expected():
]
assert result == expected
+
def test_non_csv_file_should_return_no_content():
content = ""
result = csv_reader(content)
expected = []
- assert result == expected \ No newline at end of file
+ assert result == expected
git.ajschof.me — hosted by ajschofield — powered by cgit