Ejemplo n.º 1
0
 def test_copy_filelist(self):
     '''Should copy select files from source to destination'''
     globs = tools.expand_references(HERE, ['**/test_file.txt'])
     tools.copy_filelist(HERE, self.tmp, globs)
     self.assertTrue(os.path.isfile(os.path.join(self.tmp, 'resources/subdir/test_file.txt')))
     self.assertTrue(os.path.isfile(os.path.join(self.tmp, 'resources/another_subdir/test_file.txt')))
     self.assertFalse(os.path.isfile(os.path.join(self.tmp, 'resources/empty.ipynb')))
Ejemplo n.º 2
0
 def test_glob_splatsplat_leading(self):
     '''Should expand to test_file.txt under any path.'''
     globs = tools.expand_references(HERE, ['**/test_file.txt'])
     self.assertIn(os.path.join('resources', 'subdir', 'test_file.txt'),
                   globs, globs)
     self.assertIn(
         os.path.join('resources', 'another_subdir', 'test_file.txt'),
         globs, globs)
Ejemplo n.º 3
0
 def test_copy_filelist(self):
     '''Should copy select files from source to destination'''
     globs = tools.expand_references(HERE, ['**/test_file.txt'])
     tools.copy_filelist(HERE, self.tmp, globs)
     self.assertTrue(
         os.path.isfile(
             os.path.join(self.tmp, 'resources/subdir/test_file.txt')))
     self.assertTrue(
         os.path.isfile(
             os.path.join(self.tmp,
                          'resources/another_subdir/test_file.txt')))
     self.assertFalse(
         os.path.isfile(os.path.join(self.tmp, 'resources/empty.ipynb')))
Ejemplo n.º 4
0
 def test_glob_splat(self):
     '''Should expand to all contents under this test/ directory.'''
     globs = tools.expand_references(HERE, ['*'])
     self.assertIn('test_bundler_tools.py', globs, globs)
     self.assertIn('resources', globs, globs)
Ejemplo n.º 5
0
 def test_glob_subdir(self):
     '''Should expand to all files in the resources/ subfolder.'''
     self.assertIn('resources/empty.ipynb',
         tools.expand_references(HERE, ['resources/']))
Ejemplo n.º 6
0
 def test_glob_splatsplat_leading(self):
     '''Should expand to test_file.txt under any path.'''
     globs = tools.expand_references(HERE, ['**/test_file.txt'])
     self.assertIn('resources/subdir/test_file.txt', globs, globs)
     self.assertIn('resources/another_subdir/test_file.txt', globs, globs)
Ejemplo n.º 7
0
 def test_glob_splatsplat_trailing(self):
     '''Should expand to all descendants of this test/ directory.''' 
     globs = tools.expand_references(HERE, ['resources/**'])
     self.assertIn('resources/empty.ipynb', globs, globs)
     self.assertIn('resources/subdir/test_file.txt', globs, globs)
Ejemplo n.º 8
0
 def test_glob_splatsplat_in_middle(self):
     '''Should expand to test_file.txt deep under this test/ directory.'''
     globs = tools.expand_references(HERE, ['resources/**/test_file.txt'])
     self.assertIn('resources/subdir/test_file.txt', globs, globs)
Ejemplo n.º 9
0
 def test_glob_splatsplat_trailing(self):
     '''Should expand to all descendants of this test/ directory.'''
     globs = tools.expand_references(HERE, ['resources/**'])
     self.assertIn(os.path.join('resources', 'empty.ipynb'), globs, globs)
     self.assertIn(os.path.join('resources', 'subdir', 'test_file.txt'),
                   globs, globs)
Ejemplo n.º 10
0
 def test_glob_splatsplat_in_middle(self):
     '''Should expand to test_file.txt deep under this test/ directory.'''
     globs = tools.expand_references(HERE, ['resources/**/test_file.txt'])
     self.assertIn(os.path.join('resources', 'subdir', 'test_file.txt'),
                   globs, globs)
Ejemplo n.º 11
0
 def test_glob_splat(self):
     '''Should expand to all contents under this test/ directory.'''
     globs = tools.expand_references(HERE, ['*'])
     self.assertIn('test_bundler_tools.py', globs, globs)
     self.assertIn('resources', globs, globs)
Ejemplo n.º 12
0
 def test_glob_subdir(self):
     '''Should expand to all files in the resources/ subfolder.'''
     self.assertIn(os.path.join('resources', 'empty.ipynb'),
                   tools.expand_references(HERE, ['resources/']))
Ejemplo n.º 13
0
 def test_glob_dir(self):
     '''Should expand to single file in the resources/ subfolder.'''
     self.assertIn('resources/empty.ipynb',
                   tools.expand_references(HERE, ['resources/empty.ipynb']))