예제 #1
0
 def test_check_file_permission_is_true(self):
     self.path = join(HERE, 'test_data', 'Executable file')
     self.string = "ERROR: .{path}/file_permission.py is marked as stand-alone executable".format(
         path=self.path)
     file_index = create_file_index(self.path)
     check_file_permission(self.report, file_index)
     records = [
         Record.__str__(r)
         for r in ReportManager.getEnabledReporters()[0].reports
     ]
     flag = any(s == self.string for s in records)
     self.assertTrue(flag)
예제 #2
0
 def test_check_file_permission_is_true(self):
     path = join(HERE, 'test_data', 'Executable_file')
     string = "ERROR: {path} is marked as stand-alone executable"\
         .format(path=relative_path(join(path, "file_permission.py")))
     file_index = create_file_index(path)
     check_file_permission(self.report, file_index)
     records = [
         Record.__str__(r)
         for r in ReportManager.getEnabledReporters()[0].reports
     ]
     flag = any(s == string for s in records)
     if os.name == "nt":
         self.assertFalse(flag)
     else:
         self.assertTrue(flag)
예제 #3
0
 def test_check_file_permission_is_None(self):
     self.path = join(HERE, 'test_data', 'Non-Executable file')
     file_index = create_file_index(self.path)
     self.assertIsNone(check_file_permission(self.report, file_index))