aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_csv_reader.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/test_csv_reader.py b/test/test_csv_reader.py
index 7f54c25..0ce3401 100644
--- a/test/test_csv_reader.py
+++ b/test/test_csv_reader.py
@@ -5,21 +5,24 @@ from obfuscator.csv_reader import CSVReader
reader = CSVReader()
-
+# Check if the function can read a CSV string with no content and return
+# an empty list
def test_empty_csv_should_return_no_content():
content = ""
result = reader.read_string(content)
expected = []
assert result == expected
-
+# Check if the function can read a CSV string with only a header and return
+# an empty list
def test_csv_with_header_only_should_return_no_content():
content = "student_id,name,course\n"
result = reader.read_string(content)
expected = []
assert result == expected
-
+# Check if the function can read a CSV string with valid data and return
+# a list of dictionaries
def test_csv_with_valid_data():
content = (
"student_id,name,course\n"
@@ -33,7 +36,8 @@ def test_csv_with_valid_data():
]
assert result == expected
-
+# Check if the function can read a CSV string with quoted fields and return
+# a list of dictionaries with the quoted fields intact
def test_csv_with_quoted_fields_should_run_as_expected():
content = (
"student_id,name,course\n"
git.ajschof.me — hosted by ajschofield — powered by cgit