def owner_from_path_should_match(self, owner, path):
     """
     Return True if the owner matches user name of the path
     """
     path_owner = self.get_owner_from_path(path)
     asserts.fail_unless_equal(
         owner, path_owner, "Owner From Path %s Should Match %s, but instead is %s" % (path, owner, path_owner)
     )
 def group_from_path_should_match(self, group, path):
     """
     Return True if the group matches user name of the path
     """
     path_group = self.get_group_from_path(path)
     asserts.fail_unless_equal(
         group, path_group, "Group From Path %s Should Match %s, but instead is %s" % (path, group, path_group)
     )
 def permissions_from_path_should_match(self, path, mode):
     """
     Returns True if the the octal values of the path mactches the mode.
     ie '0755'
     """
     info = os.lstat(self.get_path(path))
     myoct = oct(info.st_mode & 0777)
     asserts.fail_unless_equal(str(myoct), str(mode), 'Permissions from Path %s Should Match %s but instead are %s' % (path, mode, myoct))
Beispiel #4
0
 def owner_from_path_should_match(self, owner, path):
     """
     Return True if the owner matches user name of the path
     """
     path_owner = self.get_owner_from_path(path)
     asserts.fail_unless_equal(
         owner, path_owner,
         'Owner From Path %s Should Match %s, but instead is %s' %
         (path, owner, path_owner))
Beispiel #5
0
 def permissions_from_path_should_match(self, path, mode):
     """
     Returns True if the the octal values of the path mactches the mode.
     ie '0755'
     """
     info = os.lstat(self.get_path(path))
     myoct = oct(info.st_mode & 0777)
     asserts.fail_unless_equal(
         str(myoct), str(mode),
         'Permissions from Path %s Should Match %s but instead are %s' %
         (path, mode, myoct))