| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 | # ical2vdir - convert .ics file to vdir directory## Copyright (C) 2020 Fabian Peter Hammerle <fabian@hammerle.me>## This program is free software: you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation, either version 3 of the License, or# (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program.  If not, see <https://www.gnu.org/licenses/>.import icalendar.calimport pytestimport ical2vdir@pytest.mark.parametrize(    ("event_a_ical", "event_b_ical", "expected_result"),    (        [            (                """BEGIN:VEVENTSUMMARY:partyDTSTART:20201024T100000ZDTEND:20201026T120000ZDTSTAMP:20200205T160640ZUID:123456789@google.comSEQUENCE:0CREATED:20191231T103841ZDESCRIPTION:LAST-MODIFIED:20191231T103841ZLOCATION:STATUS:CONFIRMEDTRANSP:OPAQUEEND:VEVENT""",                """BEGIN:VEVENTSUMMARY:partyDTSTART:20201024T100000ZDTEND:20201026T120000ZDTSTAMP:20200205T160640ZUID:123456789@google.comSEQUENCE:0CREATED:20191231T103841ZDESCRIPTION:LAST-MODIFIED:20191231T103841ZLOCATION:STATUS:CONFIRMEDTRANSP:OPAQUEEND:VEVENT""",                True,            ),            (                """BEGIN:VEVENTSUMMARY:partyDTSTART:20201024T100000ZDTEND:20201026T120000ZDTSTAMP:20200205T160640ZUID:123456789@google.comSEQUENCE:0CREATED:20191231T103841ZDESCRIPTION:LAST-MODIFIED:20191231T103841ZLOCATION:STATUS:CONFIRMEDTRANSP:OPAQUEEND:VEVENT""",                """BEGIN:VEVENTSUMMARY:partyDTSTART:20201024T100000ZDTEND:20201026T120000ZDTSTAMP:20200205T160640ZUID:123456789@google.comSEQUENCE:0CREATED:20191231T103841ZDESCRIPTION:LAST-MODIFIED:20191231T103841ZSTATUS:CONFIRMEDTRANSP:OPAQUEEND:VEVENT""",                False,            ),            (                """BEGIN:VEVENTSUMMARY:partyDTSTART:20201024T100000ZDTEND:20201026T120000ZDTSTAMP:20200205T160640ZUID:123456789@google.comSEQUENCE:0CREATED:20191231T103841ZLAST-MODIFIED:20191231T103841ZEND:VEVENT""",                """BEGIN:VEVENTSUMMARY:partyDTSTART:20201024T100000ZDTEND:20201026T120000ZDTSTAMP:20200205T160640ZUID:123456789@google.comSEQUENCE:1CREATED:20191231T103841ZLAST-MODIFIED:20191231T103841ZEND:VEVENT""",                False,            ),            (                """BEGIN:VEVENTSUMMARY:partyDTSTART:20201024T100000ZDTEND:20201026T120000ZDTSTAMP:20200205T160640ZUID:123456789@google.comSEQUENCE:0CREATED:20191231T103841ZLAST-MODIFIED:20191231T103841ZEND:VEVENT""",                # ignoring DTSTAMP                """BEGIN:VEVENTSUMMARY:partyDTSTART:20201024T100000ZDTEND:20201026T120000ZDTSTAMP:20200205T200640ZUID:123456789@google.comSEQUENCE:0CREATED:20191231T103841ZLAST-MODIFIED:20191231T103841ZEND:VEVENT""",                True,            ),        ]    ),)def test__events_equal(    event_a_ical: str, event_b_ical: str, expected_result: bool) -> None:    event_a = icalendar.cal.Event.from_ical(event_a_ical)    event_b = icalendar.cal.Event.from_ical(event_b_ical)    # pylint: disable=protected-access    assert ical2vdir._events_equal(event_a, event_b) == expected_result
 |