Skip to content

Commit

Permalink
added first test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryu1845 committed Dec 22, 2021
1 parent e61d776 commit 704b514
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import twspace_dl


# https://gist.github.com/dbr/256270
def test_filename():
assert twspace_dl.FormatInfo.sterilize_fn("test.avi") == "test.avi"
assert twspace_dl.FormatInfo.sterilize_fn("Test File.avi") == "Test File.avi"
assert twspace_dl.FormatInfo.sterilize_fn("Test") == "Test"

assert twspace_dl.FormatInfo.sterilize_fn("Test/File.avi") == "Test_File.avi"
assert twspace_dl.FormatInfo.sterilize_fn("Test/File") == "Test_File"

assert twspace_dl.FormatInfo.sterilize_fn("Test/File.avi") == "Test_File.avi"
assert twspace_dl.FormatInfo.sterilize_fn('\\/:*?<Evil>|"') == "______Evil___"
assert twspace_dl.FormatInfo.sterilize_fn("COM2.txt") == "_COM2.txt"
assert twspace_dl.FormatInfo.sterilize_fn("COM2") == "_COM2"

assert twspace_dl.FormatInfo.sterilize_fn(".") == "_."
assert twspace_dl.FormatInfo.sterilize_fn("..") == "_.."
assert twspace_dl.FormatInfo.sterilize_fn("...") == "_..."

0 comments on commit 704b514

Please sign in to comment.