Exemple #1
0
def test_sanitize_filename_empty_replacement():
    name = '/<Bad File>/'
    assert utils.sanitize_filename(name, replacement=None) == 'Bad File'
Exemple #2
0
def test_sanitize_filename_empty_replacement():
    name = '/<Bad File>/'
    assert utils.sanitize_filename(name, replacement=None) == 'Bad File'
Exemple #3
0
def test_sanitize_filename(inp, expected):
    assert utils.sanitize_filename(inp) == expected
Exemple #4
0
def test_sanitize_filename(inp, expected):
    assert utils.sanitize_filename(inp) == expected
Exemple #5
0
 def test_invariants(self, filename):
     sanitized = utils.sanitize_filename(filename, shorten=True)
     assert len(os.fsencode(sanitized)) <= 255 - len("(123).download")
Exemple #6
0
 def test_shorten(self, inp, expected):
     assert utils.sanitize_filename(inp, shorten=True) == expected
Exemple #7
0
 def test_special_chars(self, inp, expected):
     assert utils.sanitize_filename(inp) == expected
Exemple #8
0
def test_sanitize_filename(inp, expected, monkeypatch):
    assert utils.sanitize_filename(inp) == expected