def _skip_if_filesystem_python3(self,
                                 dirname,
                                 explanation='needs bytes/str fix'):
     if six.PY2:
         return
     if stor.is_filesystem_path(dirname):
         raise unittest.SkipTest(
             'Skipping filesystem test on Python 3: %s' % explanation)
Beispiel #2
0
 def _skip_if_filesystem(self,
                         dirname,
                         explanation='needs bytes/str fix'):
     if stor.is_filesystem_path(dirname):
         raise unittest.SkipTest('Skipping filesystem test: %s' %
                                 explanation)
Beispiel #3
0
 def test_true(self):
     self.assertTrue(stor.is_filesystem_path('my/posix/path'))
Beispiel #4
0
 def test_false(self):
     self.assertFalse(stor.is_filesystem_path('swift://my/swift/path'))
     self.assertFalse(stor.is_filesystem_path('s3://my/s3/path'))
Beispiel #5
0
def _to_url(path):
    if stor.is_filesystem_path(path):
        raise ValueError('must be swift or s3 path')
    return stor.Path(path).to_url()