Exemple #1
0
def test_forward_slash():
    from azure.datalake.store.core import AzureDLPath

    posix_abspath = '/foo/bar'
    posix_relpath = 'foo/bar'

    abspath = AzureDLPath('/foo/bar')
    relpath = AzureDLPath('foo/bar')

    assert posix(abspath) == posix_abspath
    assert posix(abspath.trim()) == posix_relpath

    assert 'foo' in abspath
    assert 'foo' in relpath

    assert posix(AzureDLPath('/*').globless_prefix) == '/'
    assert posix(AzureDLPath('/foo/*').globless_prefix) == '/foo'
    assert posix(AzureDLPath('/foo/b*').globless_prefix) == '/foo'
Exemple #2
0
def test_backslash():
    from azure.datalake.store.core import AzureDLPath

    posix_abspath = '/foo/bar'
    posix_relpath = 'foo/bar'

    win_abspath = AzureDLPath('\\foo\\bar')
    win_relpath = AzureDLPath('foo\\bar')

    assert posix(win_abspath) == posix_abspath
    assert posix(win_abspath.trim()) == posix_relpath

    assert 'foo' in win_abspath
    assert 'foo' in win_relpath

    assert posix(AzureDLPath('\\*').globless_prefix) == '/'
    assert posix(AzureDLPath('\\foo\\*').globless_prefix) == '/foo'
    assert posix(AzureDLPath('\\foo\\b*').globless_prefix) == '/foo'