Ejemplo n.º 1
0
def test_safe_join_unsafe():
    with pytest.raises(NotFound):
        safe_join('/static', '/foo/bar')
        safe_join('/static', '//foo/bar')
        safe_join('/static', '../etc/passwords')
        safe_join('/static', 'foo/../../etc/passwords')
Ejemplo n.º 2
0
def test_safe_join_unsafe():
    with pytest.raises(NotFound):
        safe_join('/static', '/foo/bar')
        safe_join('/static', '//foo/bar')
        safe_join('/static', '../etc/passwords')
        safe_join('/static', 'foo/../../etc/passwords')
Ejemplo n.º 3
0
def test_safe_join_safe():
    assert safe_join('', '') == '.'
    assert safe_join('/static', 'foo/') == '/static/foo'
    assert safe_join('/static', 'foo/bar') == '/static/foo/bar'
    assert safe_join('/static/', 'foo/bar') == '/static/foo/bar'
Ejemplo n.º 4
0
def test_safe_join_safe():
    assert safe_join('', '') == '.'
    assert safe_join('/static', 'foo/') == '/static/foo'
    assert safe_join('/static', 'foo/bar') == '/static/foo/bar'
    assert safe_join('/static/', 'foo/bar') == '/static/foo/bar'