diff options
| author | Alex Schofield <git@ajschof.me> | 2025-02-11 14:57:19 +0000 |
|---|---|---|
| committer | Alex Schofield <git@ajschof.me> | 2025-02-11 14:57:19 +0000 |
| commit | 4452e3afd4fb6c7f6c3f44c90be64908aa2c67fb (patch) | |
| tree | cc296bb6d9e7c112e0e6a5fd2ea657a46e0f7456 | |
| parent | 3ec4c97f2f2fa07e63cc5781807f62883043490b (diff) | |
| download | gdpr-obfuscator-4452e3afd4fb6c7f6c3f44c90be64908aa2c67fb.tar.gz gdpr-obfuscator-4452e3afd4fb6c7f6c3f44c90be64908aa2c67fb.zip | |
add functionality for testing quoted fields in csv_reader
| -rw-r--r-- | test/test_csv_reader.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/test_csv_reader.py b/test/test_csv_reader.py index 38c3957..7d13d5a 100644 --- a/test/test_csv_reader.py +++ b/test/test_csv_reader.py @@ -29,9 +29,18 @@ def test_csv_with_valid_data(): ] assert result == expected -@pytest.mark.skip(reason="Not implemented yet") def test_csv_with_quoted_fields_should_be_sanitised(): - pass + 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 @pytest.mark.skip(reason="Not implemented yet") def test_non_csv_file_should_return_no_content(): |
