+ def assertFileMode(self, file_name, expected_mode):
+ """Checks that the mode of a file is what we expect.
+
+ @type file_name: str
+ @param file_name: the file whose contents we should check
+ @type expected_mode: int
+ @param expected_mode: the mode we expect
+
+ """
+ st = os.stat(file_name)
+ actual_mode = stat.S_IMODE(st.st_mode)
+ self.assertEqual(actual_mode, expected_mode)
+