Example #1
0
 def test_is_visible_subdir_ignores_hidden_directories(self):
     base_dir = self.make_dir()
     hidden_dir = factory.make_name('.')
     os.makedirs(os.path.join(base_dir, hidden_dir))
     self.assertFalse(is_visible_subdir(base_dir, hidden_dir))
Example #2
0
 def test_is_visible_subdir_recognizes_subdirectory(self):
     base_dir = self.make_dir()
     subdir = factory.make_name('subdir')
     os.makedirs(os.path.join(base_dir, subdir))
     self.assertTrue(is_visible_subdir(base_dir, subdir))
Example #3
0
 def test_is_visible_subdir_ignores_regular_files(self):
     plain_file = self.make_file()
     self.assertFalse(
         is_visible_subdir(os.path.dirname(plain_file),
                           os.path.basename(plain_file)))