def parse(self):
        """Parse log file produced by the Test Case Importer."""
        existing_items = []
        duplicate_items = []
        new_items = []
        for line in self.fp:
            line = line.strip()
            if "Updated test case" in line:
                existing_it = self.get_testcase(line)
                if existing_it:
                    existing_items.append(existing_it)
            elif "Found multiple work items with the title" in line:
                duplicate_it = self.get_testcase_warn(line)
                if duplicate_it:
                    duplicate_items.append(duplicate_it)
            elif "Created test case" in line:
                new_it = self.get_testcase(line)
                if new_it:
                    new_items.append(new_it)

        outcome = ParsedLog("testcase", new_items, existing_items, duplicate_items)

        if not outcome:
            raise Dump2PolarionException(
                "No valid data found in the log file '{}'".format(self.log_file)
            )

        return outcome
def parse ( self ) : existing_items = [ ] duplicate_items = [ ] new_items = [ ] for line in self . fp : line = line . strip ( ) if "Updated test case" in line : existing_it = self . get_testcase ( line ) if existing_it : existing_items . append ( existing_it ) elif "Found multiple work items with the title" in line : duplicate_it = self . get_testcase_warn ( line ) if duplicate_it : duplicate_items . append ( duplicate_it ) elif "Created test case" in line : new_it = self . get_testcase ( line ) if new_it : new_items . append ( new_it ) outcome = ParsedLog ( "testcase" , new_items , existing_items , duplicate_items ) if not outcome : raise Dump2PolarionException ( "No valid data found in the log file '{}'" . format ( self . log_file ) ) return outcome
Parse log file produced by the Test Case Importer.