Closed yuwash closed 7 months ago
The pull request #347 didn’t contain a test that showed the difference, so here it is. Without the fix, the test would’ve failed like:
… for ical in non_broken_ical: > assert vcal.fix(ical) == ical tests/test_vcal.py:262: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ caldav/lib/vcal.py:81: in fix "\n".join(filter(LineFilterDiscardingDuplicates(), fixed.strip().split("\n"))) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <caldav.lib.vcal.LineFilterDiscardingDuplicates object at 0x7a99fd022820> line = 'DTSTAMP:20210205T101751Z' def __call__(self, line): if line.startswith("BEGIN:V"): self.stamped = 0 self.ended = 0 elif re.match("(DURATION|DTEND|DUE)[:;]", line): if self.ended: return False self.ended += 1 elif re.match("DTSTAMP[:;]", line): > if self.stamped: E AttributeError: 'LineFilterDiscardingDuplicates' object has no attribute 'stamped' caldav/lib/vcal.py:141: AttributeError
Perfect. This closes #349
While it also would be nice with some unit test exercising the new class specifically, I believe it should already be more or less covered by existing tests.
The pull request #347 didn’t contain a test that showed the difference, so here it is. Without the fix, the test would’ve failed like: