コード例 #1
0
    def __enter__(self):
        """ :rtype: ErtShell """
        test_area = self.test_area_context.__enter__()
        test_area.copy_parent_content(self.config_file)
        self.shell = ErtShell(forget_history=True)

        config_file = os.path.basename(self.config_file)

        if self.load_config:
            self.shell.onecmd("load_config %s" % config_file)

        return self.shell
コード例 #2
0
    def __enter__(self):
        """ :rtype: ErtShell """
        test_area = self.test_area_context.__enter__()

        if os.path.exists(self.config_file):
            test_area.copy_parent_content(self.config_file)
        elif self.config_file is not None:
            raise IOError("The config file: '%s' does not exist!" % self.config_file)

        self.shell = ErtShell(forget_history=True)

        config_file = os.path.basename(self.config_file)

        if self.load_config:
            self.shell.onecmd("load_config %s" % config_file)

        return self.shell