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