def test_w_swift_component(self): p = posix.PosixPath('my/path') / swift.SwiftPath( 'swift://t/c/name').name self.assertEquals(p, posix.PosixPath('my/path/name')) self.assertEquals( stor.join('my/path', swift.SwiftPath('swift://t/c/name').name), p)
def test_invalid_radd(self): with self.assertRaisesRegexp(TypeError, 'unsupported operand'): 1 + posix.PosixPath('my/path')
def test_w_s3_component(self): p = posix.PosixPath('my/path') + s3.S3Path('s3://b/name').name self.assertEquals(p, posix.PosixPath('my/pathname'))
def test_w_swift_component(self): p = posix.PosixPath('my/path') + swift.SwiftPath( 'swift://t/c/name').name self.assertEquals(p, posix.PosixPath('my/pathname'))
def test_w_windows_path(self): with self.assertRaisesRegexp(TypeError, 'unsupported operand'): posix.PosixPath('my/path') + windows.WindowsPath(r'other\path')
def test_success(self): p = posix.PosixPath('my/path') + 'other/path' self.assertEquals(p, posix.PosixPath('my/pathother/path'))
def test_w_s3_component(self): p = posix.PosixPath('my/path') / s3.S3Path('s3://b/name').name self.assertEquals(p, posix.PosixPath('my/path/name')) self.assertEquals(stor.join('my/path', s3.S3Path('s3://b/name').name), p)
def test_rdiv(self): p = 'my/path' / posix.PosixPath('other/path') self.assertEquals(p, posix.PosixPath('my/path/other/path'))
def test_success(self): p = posix.PosixPath('my/path') / 'other/path' self.assertEquals(p, posix.PosixPath('my/path/other/path')) self.assertEquals(p, stor.join('my/path', 'other/path'))
def test_w_posix_path(self): with self.assertRaisesRegexp(TypeError, 'unsupported operand'): windows.WindowsPath(r'my\path') / posix.PosixPath('other/path')