def test_scan_with_exclusion_of_a_file(self): # scan the directory and store the number of files found there count_of_all = count_of(DirectoryScanner().performScan( utils.good_app_path())) self.assertTrue(count_of_all > 0) if Platform.isMac: self.t.file_excludes.append( r'.*/TextEdit.app/Contents/Info.plist$') else: self.t.file_excludes.append(r'.*python.exe$') count = count_of(self.t.performScan(utils.good_app_path())) self.assertEqual(count, count_of_all - 1)
def test_scan_can_run_on_an_existing_path_and_find_some_files(self): count = count_of(self.t.performScan(utils.good_app_path())) logger.info("text edit.app contains {0} items".format(count)) self.assertNotEqual(count, 0, "should not be None, text edit exists right?")
def test_scan_with_exclusion_of_everything(self): self.t.dir_excludes.append(r'.*') self.t.file_excludes.append(r'.*') count = count_of(self.t.performScan(utils.good_app_path())) self.assertEqual(count, 0)
def test_scanner_can_cope_with_scanning_a_bad_path(self): results = self.t.performScan(utils.bad_app_path()) self.assertEqual(0, count_of(results))