Esempio n. 1
0
    def test_folder_two_children_str(self):
        folder = LocalFolder('stuff')
        folder.add_child(LocalFile('setup.py'))
        folder.add_child(LocalFile('requirements.txt'))
        self.assertEqual(get_file_or_folder_paths(folder), [
            'stuff',
            'stuff/requirements.txt',
            'stuff/setup.py',

        ])
Esempio n. 2
0
 def test_nested_folder_str(self):
     grand = LocalFolder('grand')
     parent = LocalFolder('parent')
     parent.add_child(LocalFile('setup.py'))
     parent.add_child(LocalFile('requirements.txt'))
     otherparent = LocalFolder('otherparent')
     grand.add_child(parent)
     grand.add_child(otherparent)
     self.assertEqual(get_file_or_folder_paths(grand), [
         'grand',
         'grand/otherparent',
         'grand/parent',
         'grand/parent/requirements.txt',
         'grand/parent/setup.py',
     ])
Esempio n. 3
0
 def test_folder_up_and_back(self):
     content = LocalFolder('../DukeDSClient')
     self.assertEqual('DukeDSClient', content.name)
Esempio n. 4
0
 def test_folder_name_no_slash(self):
     content = LocalFolder('/tmp/DukeDsClientTestFolder')
     self.assertEqual('DukeDsClientTestFolder', content.name)
     self.assertEqual('/tmp/DukeDsClientTestFolder', content.path)
Esempio n. 5
0
 def test_folder_dot_name(self):
     content = LocalFolder('.')
     self.assertEqual('DukeDSClient', content.name)
Esempio n. 6
0
 def test_nested_folder_str(self):
     grand = LocalFolder('grand')
     parent = LocalFolder('parent')
     parent.add_child(LocalFile('setup.py'))
     parent.add_child(LocalFile('requirements.txt'))
     otherparent = LocalFolder('otherparent')
     grand.add_child(parent)
     grand.add_child(otherparent)
     self.assertEqual(('folder:grand ['
                        'folder:parent [file:setup.py, file:requirements.txt], '
                        'folder:otherparent []]'), str(grand))
Esempio n. 7
0
 def test_folder_two_children_str(self):
     folder = LocalFolder('stuff')
     folder.add_child(LocalFile('setup.py'))
     folder.add_child(LocalFile('requirements.txt'))
     self.assertEqual('folder:stuff [file:setup.py, file:requirements.txt]', str(folder))
Esempio n. 8
0
 def test_folder_one_child_str(self):
     folder = LocalFolder('stuff')
     folder.add_child(LocalFile('setup.py'))
     self.assertEqual('folder:stuff [file:setup.py]', str(folder))
Esempio n. 9
0
 def test_empty_folder_str(self):
     f = LocalFolder('stuff')
     self.assertEqual('folder:stuff []', str(f))
Esempio n. 10
0
 def test_folder_one_child_str(self):
     folder = LocalFolder('stuff')
     folder.add_child(LocalFile('setup.py'))
     self.assertEqual(get_file_or_folder_paths(folder), ['stuff', 'stuff/setup.py'])