Example #1
0
 def create(self, acl=None):
     '''Creates a directory, optionally include Acl argument to set permissions'''
     parent, name = getParentAndBase(self.path)
     json = { 'name': name }
     if acl is not None:
         json['acl'] = acl.to_api_param()
     response = self.client.postJsonHelper(DataDirectory._getUrl(parent), json, False)
     if (response.status_code != 200):
         raise Exception("Directory creation failed: " + str(response.content))
Example #2
0
 def test_getParentAndBase(self):
     self.assertEqual(('a/b', 'c'), getParentAndBase('a/b/c'))
     self.assertEqual(('a/b', 'c'), getParentAndBase('a/b/c///'))
     self.assertEqual(('//a//b', 'c'), getParentAndBase('//a//b////c///'))
Example #3
0
 def test_getParentAndBase(self):
     self.assertEqual(('a/b', 'c'), getParentAndBase('a/b/c'))
     self.assertEqual(('a/b', 'c'), getParentAndBase('a/b/c///'))
     self.assertEqual(('//a//b', 'c'), getParentAndBase('//a//b////c///'))
Example #4
0
 def getName(self):
     _, name = getParentAndBase(self.path)
     return name
 def getName(self):
     _, name = getParentAndBase(self.path)
     return name
Example #6
0
 def test_getParentAndBase(self):
     self.assertEqual(('a/b', 'c'), getParentAndBase('a/b/c'))
     self.assertEqual(('data://foo', 'bar'), getParentAndBase('data://foo/bar'))
     self.assertEqual(('data:///', 'foo'), getParentAndBase('data:///foo'))
     self.assertEqual(('data://', 'foo'), getParentAndBase('data://foo'))
 def test_getParentAndBase(self):
     self.assertEqual(('a/b', 'c'), getParentAndBase('a/b/c'))
     self.assertEqual(('data://foo', 'bar'), getParentAndBase('data://foo/bar'))
     self.assertEqual(('data:///', 'foo'), getParentAndBase('data:///foo'))
     self.assertEqual(('data://', 'foo'), getParentAndBase('data://foo'))