How to use the s3path.PureS3Path function in s3path

To help you get started, we’ve selected a few s3path examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github liormizr / s3path / tests / test_pure_path_operations.py View on Github external
def test_reserved():
    assert not PureS3Path('/a/b').is_reserved()
    assert not PureS3Path('a/b').is_reserved()
github liormizr / s3path / tests / test_pure_path_operations.py View on Github external
def test_repr():
    assert repr(PureS3Path('setup.py')) == "PureS3Path('setup.py')"
    assert str(PureS3Path('setup.py')) == 'setup.py'
    assert bytes(PureS3Path('setup.py')) == b'setup.py'
    assert PureS3Path('/usr/bin').as_posix() == '/usr/bin'
github liormizr / s3path / tests / test_pure_path_operations.py View on Github external
def test_parent():
    assert PureS3Path('foo//bar').parent == PureS3Path('foo')
    assert PureS3Path('foo/./bar').parent == PureS3Path('foo')
    assert PureS3Path('foo/../bar').parent == PureS3Path('.')
    assert PureS3Path('../bar').parent == PureS3Path('..')
    assert PureS3Path('foo', '../bar').parent == PureS3Path('.')
    assert PureS3Path('/foo/bar').parent == PureS3Path('/foo')
    assert PureS3Path('.').parent == PureS3Path('.')
    assert PureS3Path('/').parent == PureS3Path('/')
github liormizr / s3path / tests / test_pure_path_operations.py View on Github external
def test_join_strs():
    assert PureS3Path('foo', 'some/path', 'bar') == PureS3Path('foo/some/path/bar')
github liormizr / s3path / tests / test_pure_path_operations.py View on Github external
def test_parts():
    assert PureS3Path('foo//bar').parts == ('foo', 'bar')
    assert PureS3Path('foo/./bar').parts == ('foo', 'bar')
    assert PureS3Path('foo/../bar').parts == ('bar',)
    assert PureS3Path('../bar').parts == ('..', 'bar')
    assert PureS3Path('foo', '../bar').parts == ('bar',)
    assert PureS3Path('/foo/bar').parts == ('/', 'foo', 'bar')
github liormizr / s3path / tests / test_pure_path_operations.py View on Github external
def test_match():
    assert PureS3Path('a/b.py').match('*.py')
    assert PureS3Path('/a/b/c.py').match('b/*.py')
    assert not PureS3Path('/a/b/c.py').match('a/*.py')
    assert PureS3Path('/a.py').match('/*.py')
    assert not PureS3Path('a/b.py').match('/*.py')
    assert not PureS3Path('a/b.py').match('*.Py')
github liormizr / s3path / tests / test_pure_path_operations.py View on Github external
def test_absolute():
    assert PureS3Path('/a/b').is_absolute()
    assert not PureS3Path('a/b').is_absolute()
github liormizr / s3path / tests / test_pure_path_operations.py View on Github external
def test_parent():
    assert PureS3Path('foo//bar').parent == PureS3Path('foo')
    assert PureS3Path('foo/./bar').parent == PureS3Path('foo')
    assert PureS3Path('foo/../bar').parent == PureS3Path('.')
    assert PureS3Path('../bar').parent == PureS3Path('..')
    assert PureS3Path('foo', '../bar').parent == PureS3Path('.')
    assert PureS3Path('/foo/bar').parent == PureS3Path('/foo')
    assert PureS3Path('.').parent == PureS3Path('.')
    assert PureS3Path('/').parent == PureS3Path('/')
github liormizr / s3path / tests / test_pure_path_operations.py View on Github external
def test_root():
    assert PureS3Path('foo//bar').root == ''
    assert PureS3Path('foo/./bar').root == ''
    assert PureS3Path('foo/../bar').root == ''
    assert PureS3Path('../bar').root == ''
    assert PureS3Path('foo', '../bar').root == ''
    assert PureS3Path('/foo/bar').root == '/'