def is_child_of(self, parent):
self.is_file()<EOL>if not isinstance(parent, str_types):<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>val_abspath = os.path.abspath(self.val)<EOL>parent_abspath = os.path.abspath(parent)<EOL>if not val_abspath.startswith(parent_abspath):<EOL><INDENT>self._err('<STR_LIT>' % (val_abspath, parent_abspath))<EOL><DEDENT>return self<EOL>
Asserts that val is an existing path to a file and that file is a child of parent.