test_patch_set.py 475 B

12345678910111213141516
  1. from sentry.utils.patch_set import patch_to_file_changes
  2. def test_filename_containing_spaces():
  3. # regression test for https://sentry.io/organizations/sentry/issues/3279066697
  4. patch = """\
  5. diff --git a/has spaces/t.sql b/has spaces/t.sql
  6. new file mode 100644
  7. index 0000000..8a9b485
  8. --- /dev/null
  9. +++ b/has spaces/t.sql
  10. @@ -0,0 +1 @@
  11. +select * FROM t;
  12. """
  13. expected = [{"path": "has spaces/t.sql", "type": "A"}]
  14. assert patch_to_file_changes(patch) == expected