def check_directory(self, path, expected_path):

        self.assertEqual(path, expected_path)
        self.assertTrue(os.path.isdir(path),
                        "Test directory does not seem to have been " +
                        "created:\n" + path)

        # Check directory permissons. We are interested in user, group, and
        # world permisions (not SUID, SGID, or sticky bit). This is octal
        # 0777 as a mask.
        mode = os.stat(path).st_mode & 0o0777
        # We want all user and group permissions, but not world permisions.
        # This is octal 770.
        self.assertEqual(mode, 0o770, "Test directory has the wrong " +
                         "permissions:\n" + path)
Check that a directory exists and has the right path.
dataset/ETHPy150Open GeoscienceAustralia/agdc/tests/test_dbutil.py/TestUtilityFunctions.check_directory