from datetime import datetime
from re import compile
from unittest import main

from ir_datasets.formats import ArgsMeDoc, ArgsMeStance, ArgsMePremise, \
    ArgsMeSourceDomain, ArgsMeMode, ArgsMeAspect, ArgsMeProcessedDoc
from ir_datasets.formats.argsme import ArgsMeSentence
from test.integration.base import DatasetIntegrationTest


class TestArgsMe(DatasetIntegrationTest):
    # noinspection PyTypeChecker
    def test_docs(self):
        self._test_docs("argsme/1.0", count=387692, items={
            0: ArgsMeDoc(
                doc_id="c67482ba-2019-04-18T13:32:05Z-00000-000",
                conclusion="Contraceptive Forms for High School Students",
                premises=[
                    ArgsMePremise(
                        text=compile("My opponent forfeited every round\. None of my argu.{393}it is illegal to sell you them is, frankly, wrong\."),
                        stance=ArgsMeStance.CON,
                        annotations=[],
                    ),
                ],
                premises_texts=compile("My opponent forfeited every round\. None of my argu.{393}it is illegal to sell you them is, frankly, wrong\."),
                aspects=[],
                aspects_names="",
                source_id="c67482ba-2019-04-18T13:32:05Z",
                source_title="Debate Argument: Contraceptive Forms for High School Students | Debate.org",
                source_url="https://www.debate.org/debates/Contraceptive-Forms-for-High-School-Students/1/",
                source_previous_argument_id=None,
                source_next_argument_id="c67482ba-2019-04-18T13:32:05Z-00001-000",
                source_domain=None,
                source_text=None,
                source_text_conclusion_start=None,
                source_text_conclusion_end=None,
                source_text_premise_start=None,
                source_text_premise_end=None,
                topic="Contraceptive Forms for High School Students",
                acquisition=datetime.fromisoformat(
                    "2019-04-18T13:32:05+00:00"),
                date=None,
                author=None,
                author_image_url=None,
                author_organization=None,
                author_role=None,
                mode=None,
            ),
            387691: ArgsMeDoc(
                doc_id="671509c8-2019-04-17T11:47:34Z-00007-000",
                conclusion="Charter schools",
                premises=[
                    ArgsMePremise(
                        text="Charter schools are exploited most by affable students",
                        stance=ArgsMeStance.CON,
                        annotations=[],
                    ),
                ],
                premises_texts="Charter schools are exploited most by affable students",
                aspects=[],
                aspects_names="",
                source_id="671509c8-2019-04-17T11:47:34Z",
                source_title="Debate: Charter schools - Debatepedia",
                source_url="http://www.debatepedia.org/en/index.php/Debate:_Charter_schools",
                source_previous_argument_id="671509c8-2019-04-17T11:47:34Z-00022-000",
                source_next_argument_id="671509c8-2019-04-17T11:47:34Z-00057-000",
                source_domain=None,
                source_text=None,
                source_text_conclusion_start=None,
                source_text_conclusion_end=None,
                source_text_premise_start=None,
                source_text_premise_end=None,
                topic="Charter schools",
                acquisition=datetime.fromisoformat("2019-04-17T11:47:34+00:00"),
                date=None,
                author=None,
                author_image_url=None,
                author_organization=None,
                author_role=None,
                mode=None,
            ),
        })
        self._test_docs("argsme/1.0-cleaned", count=382545, items={
            0: ArgsMeDoc(
                doc_id="c67482ba-2019-04-18T13:32:05Z-00000-000",
                conclusion="Contraceptive Forms for High School Students",
                premises=[
                    ArgsMePremise(
                        text=compile("My opponent forfeited every round\. None of my argu.{393}it is illegal to sell you them is, frankly, wrong\."),
                        stance=ArgsMeStance.CON,
                        annotations=[],
                    ),
                ],
                premises_texts=compile("My opponent forfeited every round\. None of my argu.{393}it is illegal to sell you them is, frankly, wrong\."),
                aspects=[],
                aspects_names="",
                source_id="c67482ba-2019-04-18T13:32:05Z",
                source_title="Debate Argument: Contraceptive Forms for High School Students | Debate.org",
                source_url="https://www.debate.org/debates/Contraceptive-Forms-for-High-School-Students/1/",
                source_previous_argument_id=None,
                source_next_argument_id="c67482ba-2019-04-18T13:32:05Z-00001-000",
                source_domain=None,
                source_text=None,
                source_text_conclusion_start=None,
                source_text_conclusion_end=None,
                source_text_premise_start=None,
                source_text_premise_end=None,
                topic="Contraceptive Forms for High School Students",
                acquisition=datetime.fromisoformat("2019-04-18T13:32:05+00:00"),
                date=None,
                author=None,
                author_image_url=None,
                author_organization=None,
                author_role=None,
                mode=None,
            ),
            382544: ArgsMeDoc(
                doc_id="671509c8-2019-04-17T11:47:34Z-00007-000",
                conclusion="Charter schools",
                premises=[
                    ArgsMePremise(
                        text="Charter schools are exploited most by affable students",
                        stance=ArgsMeStance.CON,
                        annotations=[],
                    ),
                ],
                premises_texts="Charter schools are exploited most by affable students",
                aspects=[],
                aspects_names="",
                source_id="671509c8-2019-04-17T11:47:34Z",
                source_title="Debate: Charter schools - Debatepedia",
                source_url="http://www.debatepedia.org/en/index.php/Debate:_Charter_schools",
                source_previous_argument_id="671509c8-2019-04-17T11:47:34Z-00022-000",
                source_next_argument_id="671509c8-2019-04-17T11:47:34Z-00057-000",
                source_domain=None,
                source_text=None,
                source_text_conclusion_start=None,
                source_text_conclusion_end=None,
                source_text_premise_start=None,
                source_text_premise_end=None,
                topic="Charter schools",
                acquisition=datetime.fromisoformat("2019-04-17T11:47:34+00:00"),
                date=None,
                author=None,
                author_image_url=None,
                author_organization=None,
                author_role=None,
                mode=None,
            ),
        })
        self._test_docs("argsme/2020-04-01", count=387740, items={
            0: ArgsMeDoc(
                doc_id="Sb38112c8-A443a9828",
                conclusion="school",
                premises=[
                    ArgsMePremise(
                        text="Done.",
                        stance=ArgsMeStance.PRO,
                        annotations=[],
                    ),
                ],
                premises_texts="Done.",
                aspects=[],
                aspects_names="",
                source_id="Sb38112c8",
                source_title="Debate: school | Debate.org",
                source_url="https://www.debate.org/debates/school/3/",
                source_previous_argument_id=None,
                source_next_argument_id=None,
                source_domain=ArgsMeSourceDomain.debateorg,
                source_text=compile("DEBATES OPINIONS FORUMS POLLS Google Search My Deb.{3149}p Version © 2019 Debate\.org\. All rights reserved\. "),
                source_text_conclusion_start=1630,
                source_text_conclusion_end=1636,
                source_text_premise_start=2664,
                source_text_premise_end=2670,
                topic="school",
                acquisition=datetime.fromisoformat("2019-04-18T17:49:41+00:00"),
                date=None,
                author=None,
                author_image_url=None,
                author_organization=None,
                author_role=None,
                mode=ArgsMeMode.discussion,
            ),
            387739: ArgsMeDoc(
                doc_id="S153cd52f-A118dded8",
                conclusion=compile("The recent throne speech said that the government .{27}o ensure that our communities continue to be safe\."),
                premises=[
                    ArgsMePremise(
                        text=compile("How can Canadians trust the Liberals when they say.{1049}replaced by the system changers in the opposition\."),
                        stance=ArgsMeStance.CON,
                        annotations=[],
                    ),
                ],
                premises_texts=compile("How can Canadians trust the Liberals when they say.{1049}replaced by the system changers in the opposition\."),
                aspects=[
                    ArgsMeAspect(
                        name="Pornography",
                        weight=3,
                        normalized_weight=1,
                        rank=1,
                    ),
                ],
                aspects_names="Pornography",
                source_id="S153cd52f",
                source_title="4129762",
                source_url=None,
                source_previous_argument_id=None,
                source_next_argument_id=None,
                source_domain=ArgsMeSourceDomain.canadian_parliament,
                source_text=compile("How can Canadians trust the Liberals when they say.{1050}eplaced by the system changers in the opposition\. "),
                source_text_conclusion_start=149,
                source_text_conclusion_end=276,
                source_text_premise_start=0,
                source_text_premise_end=1149,
                topic="Child Pornography",
                acquisition=datetime.fromisoformat("2019-07-25T09:33:44.811404+00:00"),
                date=datetime.fromisoformat("1999-10-17T22:00:00+00:00"),
                author="Paul Forseth",
                author_image_url="https://www.ourcommons.ca/Parliamentarians/Images/OfficialMPPhotos/38/Forsep.JPG",
                author_organization="Reform",
                author_role="Opposition",
                mode=ArgsMeMode.person,
            ),
        })
        self._test_docs("argsme/2020-04-01/debateorg", count=338620, items={
            0: ArgsMeDoc(
                doc_id="Sb38112c8-A443a9828",
                conclusion="school",
                premises=[
                    ArgsMePremise(
                        text="Done.",
                        stance=ArgsMeStance.PRO,
                        annotations=[],
                    ),
                ],
                premises_texts="Done.",
                aspects=[],
                aspects_names="",
                source_id="Sb38112c8",
                source_title="Debate: school | Debate.org",
                source_url="https://www.debate.org/debates/school/3/",
                source_previous_argument_id=None,
                source_next_argument_id=None,
                source_domain=ArgsMeSourceDomain.debateorg,
                source_text=compile("DEBATES OPINIONS FORUMS POLLS Google Search My Deb.{3149}p Version © 2019 Debate\.org\. All rights reserved\. "),
                source_text_conclusion_start=1630,
                source_text_conclusion_end=1636,
                source_text_premise_start=2664,
                source_text_premise_end=2670,
                topic="school",
                acquisition=datetime.fromisoformat("2019-04-18T17:49:41+00:00"),
                date=None,
                author=None,
                author_image_url=None,
                author_organization=None,
                author_role=None,
                mode=ArgsMeMode.discussion,
            ),
            338619: ArgsMeDoc(
                doc_id="Sca72da7d-Adbd84fd2",
                conclusion="It Should be Legal in the U.S. to Occasionally Hit Someone",
                premises=[
                    ArgsMePremise(
                        text=compile("In this debate, I will argue that occasionally hit.{2302}fe\. My opponent may begin his argument\. Good luck\."),
                        stance=ArgsMeStance.PRO,
                        annotations=[],
                    ),
                ],
                premises_texts=compile("In this debate, I will argue that occasionally hit.{2302}fe\. My opponent may begin his argument\. Good luck\."),
                aspects=[
                    ArgsMeAspect(
                        name="Obesity",
                        weight=1,
                        normalized_weight=1,
                        rank=1,
                    ),
                ],
                aspects_names="Obesity",
                source_id="Sca72da7d",
                source_title="Debate Topic: It Should be Legal in the U.S. to Occasionally Hit Someone | Debate.org",
                source_url="https://www.debate.org/debates/It-Should-be-Legal-in-the-U.S.-to-Occasionally-Hit-Someone/1/",
                source_previous_argument_id=None,
                source_next_argument_id=None,
                source_domain=ArgsMeSourceDomain.debateorg,
                source_text=compile("DEBATES OPINIONS FORUMS POLLS Google Search My Deb.{26529}p Version © 2019 Debate\.org\. All rights reserved\. "),
                source_text_conclusion_start=1677,
                source_text_conclusion_end=1735,
                source_text_premise_start=2391,
                source_text_premise_end=4794,
                topic="It Should be Legal in the U.S. to Occasionally Hit Someone",
                acquisition=datetime.fromisoformat("2019-04-18T19:21:03+00:00"),
                date=None,
                author=None,
                author_image_url=None,
                author_organization=None,
                author_role=None,
                mode=ArgsMeMode.discussion,
            ),
        })
        self._test_docs("argsme/2020-04-01/debatepedia", count=21197, items={
            0: ArgsMeDoc(
                doc_id="S96f2396e-Aaf079b43",
                conclusion="Mine Ban Treaty (Ottawa Treaty)",
                premises=[
                    ArgsMePremise(
                        text="Casualties in repelling N. Korean invasion would be higher w/o mines",
                        stance=ArgsMeStance.CON,
                        annotations=[],
                    ),
                ],
                premises_texts="Casualties in repelling N. Korean invasion would be higher w/o mines",
                aspects=[],
                aspects_names="",
                source_id="S96f2396e",
                source_title="Debate: Mine Ban Treaty (Ottawa Treaty) - Debatepedia",
                source_url="http://www.debatepedia.org/en/index.php/Debate:_Mine_Ban_Treaty_%28Ottawa_Treaty%29",
                source_previous_argument_id=None,
                source_next_argument_id=None,
                source_domain=ArgsMeSourceDomain.debatepedia,
                source_text=compile("Welcome to Debatepedia! \| About \| Help \| FAQ \| Med.{33182} Disclaimers Problem with the site\?  Edit Close \. "),
                source_text_conclusion_start=1063,
                source_text_conclusion_end=1094,
                source_text_premise_start=18501,
                source_text_premise_end=18569,
                topic="Mine Ban Treaty (Ottawa Treaty)",
                acquisition=datetime.fromisoformat("2019-04-17T11:47:26+00:00"),
                date=None,
                author=None,
                author_image_url=None,
                author_organization=None,
                author_role=None,
                mode=ArgsMeMode.discussion,
            ),
            21196: ArgsMeDoc(
                doc_id="S148bb110-A119d66b0",
                conclusion="Environmental impact of barages is ugly.",
                premises=[
                    ArgsMePremise(
                        text=compile("Barages are fairly massive objects, like Dams, tha.{160} and possibly reduced property values and tourism\."),
                        stance=ArgsMeStance.PRO,
                        annotations=[],
                    ),
                ],
                premises_texts=compile("Barages are fairly massive objects, like Dams, tha.{160} and possibly reduced property values and tourism\."),
                aspects=[],
                aspects_names="",
                source_id="S148bb110",
                source_title="Debate: Tidal energy - Debatepedia",
                source_url="http://www.debatepedia.org/en/index.php/Debate:_Tidal_energy",
                source_previous_argument_id=None,
                source_next_argument_id=None,
                source_domain=ArgsMeSourceDomain.debatepedia,
                source_text=compile("Welcome to Debatepedia! \| About \| Help \| FAQ \| Med.{28127} Disclaimers Problem with the site\?  Edit Close \. "),
                source_text_conclusion_start=22030,
                source_text_conclusion_end=22070,
                source_text_premise_start=22070,
                source_text_premise_end=22331,
                topic="Tidal energy",
                acquisition=datetime.fromisoformat("2019-04-17T11:47:38+00:00"),
                date=None,
                author=None,
                author_image_url=None,
                author_organization=None,
                author_role=None,
                mode=ArgsMeMode.discussion,
            ),
        })
        self._test_docs("argsme/2020-04-01/debatewise", count=14353, items={
            0: ArgsMeDoc(
                doc_id="S5920cdef-A982becb7",
                conclusion="placebo effect and phenylthiamine",
                premises=[
                    ArgsMePremise(
                        text=compile("But are chocolate eaters happy\? \[\[http://news\.bbc\..{623} health !!! as it increases our colestrol in body\."),
                        stance=ArgsMeStance.CON,
                        annotations=[],
                    ),
                ],
                premises_texts=compile("But are chocolate eaters happy\? \[\[http://news\.bbc\..{623} health !!! as it increases our colestrol in body\."),
                aspects=[],
                aspects_names="",
                source_id="S5920cdef",
                source_title="Is chocolate good for you? - DebateWise",
                source_url="https://debatewise.org/debates/1904-is-chocolate-good-for-you/",
                source_previous_argument_id=None,
                source_next_argument_id=None,
                source_domain=ArgsMeSourceDomain.debatewise,
                source_text=compile("Browse Our Categories Is chocolate good for you\? L.{10743}me \| About Us \| Privacy & Contact Us Top wpDiscuz "),
                source_text_conclusion_start=751,
                source_text_conclusion_end=784,
                source_text_premise_start=1667,
                source_text_premise_end=2390,
                topic="Is chocolate good for you?",
                acquisition=datetime.fromisoformat("2019-04-19T12:46:26+00:00"),
                date=None,
                author=None,
                author_image_url=None,
                author_organization=None,
                author_role=None,
                mode=ArgsMeMode.discussion,
            ),
            14352: ArgsMeDoc(
                doc_id="Sc47177f2-A730d8f9e",
                conclusion="NO",
                premises=[
                    ArgsMePremise(
                        text=compile("‎:/ Adolf Hitler was not evil he wasn't a murderer.{244}wer Told You To Jump Off A Bridge Would You Do It\?"),
                        stance=ArgsMeStance.PRO,
                        annotations=[],
                    ),
                ],
                premises_texts=compile("‎:/ Adolf Hitler was not evil he wasn't a murderer.{244}wer Told You To Jump Off A Bridge Would You Do It\?"),
                aspects=[
                    ArgsMeAspect(
                        name="Jews",
                        weight=2,
                        normalized_weight=0.6666666666666666,
                        rank=1,
                    ),
                    ArgsMeAspect(
                        name="Adolf Hitler",
                        weight=1,
                        normalized_weight=0.3333333333333333,
                        rank=2,
                    ),
                ],
                aspects_names="Jews Adolf Hitler",
                source_id="Sc47177f2",
                source_title="Adolf Hitler Does Not Deserve His Reputation as Evil - DebateWise",
                source_url="https://debatewise.org/debates/357-adolf-hitler-does-not-deserve-his-reputation-as-evil/",
                source_previous_argument_id=None,
                source_next_argument_id=None,
                source_domain=ArgsMeSourceDomain.debatewise,
                source_text=compile("Browse Our Categories Adolf Hitler Does Not Deserv.{54510} Us \| Privacy & Contact Us Top wpDiscuz 113shares "),
                source_text_conclusion_start=43380,
                source_text_conclusion_end=43382,
                source_text_premise_start=43383,
                source_text_premise_end=43727,
                topic="Adolf Hitler Does Not Deserve His Reputation as Evil",
                acquisition=datetime.fromisoformat("2019-04-19T12:44:52+00:00"),
                date=None,
                author=None,
                author_image_url=None,
                author_organization=None,
                author_role=None,
                mode=ArgsMeMode.discussion,
            ),
        })
        self._test_docs("argsme/2020-04-01/idebate", count=13522, items={
            0: ArgsMeDoc(
                doc_id="Sf9294c83-Af186e851",
                conclusion="the War in Iraq was Worth the Cost",
                premises=[
                    ArgsMePremise(
                        text="His removal provides stability and security not only for Iraq but for the Middle East as a region",
                        stance=ArgsMeStance.PRO,
                        annotations=[],
                    ),
                ],
                premises_texts="His removal provides stability and security not only for Iraq but for the Middle East as a region",
                aspects=[],
                aspects_names="",
                source_id="Sf9294c83",
                source_title="This House Believes that the War in Iraq was Worth the Cost | idebate.org",
                source_url="https://idebate.org/debatabase/international-middle-east-politics-terrorism-warpeace/house-believes-war-iraq-was-worth",
                source_previous_argument_id=None,
                source_next_argument_id=None,
                source_domain=ArgsMeSourceDomain.idebate,
                source_text=compile("idebate\.org Educational and informative news and r.{17520}in with\.\.\. Login with Facebook Login with Twitter "),
                source_text_conclusion_start=196,
                source_text_conclusion_end=230,
                source_text_premise_start=8137,
                source_text_premise_end=8234,
                topic="the War in Iraq was Worth the Cost",
                acquisition=datetime.fromisoformat("2019-04-19T12:40:25+00:00"),
                date=None,
                author=None,
                author_image_url=None,
                author_organization=None,
                author_role=None,
                mode=ArgsMeMode.discussion,
            ),
            13521: ArgsMeDoc(
                doc_id="Sd6cf79d9-Af8d9e187",
                conclusion="Socialism is a more secure system than the free market in Capitalism",
                premises=[
                    ArgsMePremise(
                        text=compile("In order to avoid economic crisis there is a need .{1343}agall\. Financial Times\. Retrieved June 14, 2011 1\."),
                        stance=ArgsMeStance.CON,
                        annotations=[],
                    ),
                ],
                premises_texts=compile("In order to avoid economic crisis there is a need .{1343}agall\. Financial Times\. Retrieved June 14, 2011 1\."),
                aspects=[
                    ArgsMeAspect(
                        name="Capitalism",
                        weight=2,
                        normalized_weight=0.6666666666666666,
                        rank=1,
                    ),
                    ArgsMeAspect(
                        name="Socialism",
                        weight=1,
                        normalized_weight=0.3333333333333333,
                        rank=2,
                    ),
                ],
                aspects_names="Capitalism Socialism",
                source_id="Sd6cf79d9",
                source_title="This House believes that capitalism is better than socialism | idebate.org",
                source_url="https://idebate.org/debatabase/economy-economy-general-philosophy-political-philosophy/house-believes-capitalism-better",
                source_previous_argument_id=None,
                source_next_argument_id=None,
                source_domain=ArgsMeSourceDomain.idebate,
                source_text=compile("idebate\.org Educational and informative news and r.{29663}in with\.\.\. Login with Facebook Login with Twitter "),
                source_text_conclusion_start=19722,
                source_text_conclusion_end=19790,
                source_text_premise_start=21487,
                source_text_premise_end=22930,
                topic="capitalism is better than socialism",
                acquisition=datetime.fromisoformat("2019-04-19T12:39:56+00:00"),
                date=None,
                author=None,
                author_image_url=None,
                author_organization=None,
                author_role=None,
                mode=ArgsMeMode.discussion,
            ),
        })
        self._test_docs("argsme/2020-04-01/parliamentary", count=48, items={
            0: ArgsMeDoc(
                doc_id="S1f6b58eb-A5c530110",
                conclusion=compile("I want them to know that their braids, their dread.{165} boardroom, and yes, even here on Parliament Hill\."),
                premises=[
                    ArgsMePremise(
                        text=compile("I want them to know that their braids, their dread.{165} boardroom, and yes, even here on Parliament Hill\."),
                        stance=ArgsMeStance.PRO,
                        annotations=[],
                    ),
                ],
                premises_texts=compile("I want them to know that their braids, their dread.{165} boardroom, and yes, even here on Parliament Hill\."),
                aspects=[
                    ArgsMeAspect(
                        name="Women",
                        weight=2,
                        normalized_weight=0.6666666666666666,
                        rank=1,
                    ),
                    ArgsMeAspect(
                        name="Woman",
                        weight=1,
                        normalized_weight=0.3333333333333333,
                        rank=2,
                    ),
                ],
                aspects_names="Women Woman",
                source_id="S1f6b58eb",
                source_title="4718632",
                source_url=None,
                source_previous_argument_id=None,
                source_next_argument_id=None,
                source_domain=ArgsMeSourceDomain.canadian_parliament,
                source_text=compile("This week I have my hair in braids, much like I ha.{1066}boardroom, and yes, even here on Parliament Hill\. "),
                source_text_conclusion_start=900,
                source_text_conclusion_end=1165,
                source_text_premise_start=0,
                source_text_premise_end=1165,
                topic="Body Shaming",
                acquisition=datetime.fromisoformat("2019-07-25T09:33:44.814585+00:00"),
                date=datetime.fromisoformat("2017-09-19T22:00:00+00:00"),
                author="Celina Caesar-Chavannes",
                author_image_url="https://www.ourcommons.ca/Parliamentarians/Images/OfficialMPPhotos/42/CaesarChavannesCelina_Lib.jpg",
                author_organization="Liberal",
                author_role="Government",
                mode=ArgsMeMode.person,
            ),
            47: ArgsMeDoc(
                doc_id="S153cd52f-A118dded8",
                conclusion=compile("The recent throne speech said that the government .{27}o ensure that our communities continue to be safe\."),
                premises=[
                    ArgsMePremise(
                        text=compile("How can Canadians trust the Liberals when they say.{1049}replaced by the system changers in the opposition\."),
                        stance=ArgsMeStance.CON,
                        annotations=[],
                    ),
                ],
                premises_texts=compile("How can Canadians trust the Liberals when they say.{1049}replaced by the system changers in the opposition\."),
                aspects=[
                    ArgsMeAspect(
                        name="Pornography",
                        weight=3,
                        normalized_weight=1,
                        rank=1,
                    ),
                ],
                aspects_names="Pornography",
                source_id="S153cd52f",
                source_title="4129762",
                source_url=None,
                source_previous_argument_id=None,
                source_next_argument_id=None,
                source_domain=ArgsMeSourceDomain.canadian_parliament,
                source_text=compile("How can Canadians trust the Liberals when they say.{1050}eplaced by the system changers in the opposition\. "),
                source_text_conclusion_start=149,
                source_text_conclusion_end=276,
                source_text_premise_start=0,
                source_text_premise_end=1149,
                topic="Child Pornography",
                acquisition=datetime.fromisoformat("2019-07-25T09:33:44.811404+00:00"),
                date=datetime.fromisoformat("1999-10-17T22:00:00+00:00"),
                author="Paul Forseth",
                author_image_url="https://www.ourcommons.ca/Parliamentarians/Images/OfficialMPPhotos/38/Forsep.JPG",
                author_organization="Reform",
                author_role="Opposition",
                mode=ArgsMeMode.person,
            ),
        })
        self._test_docs("argsme/2020-04-01/processed", count=365408, items={
            0: ArgsMeProcessedDoc(
                doc_id="Sf9294c83-Af186e851",
                conclusion="the War in Iraq was Worth the Cost",
                premises=[
                    ArgsMePremise(
                        text=compile("His removal provides stability and .{21} Iraq but for the Middle East as a region"),
                        stance=ArgsMeStance.PRO,
                        annotations=[],
                    ),
                ],
                premises_texts=compile("His removal provides stability and .{21} Iraq but for the Middle East as a region"),
                aspects=[],
                aspects_names="",
                source_id="Sf9294c83",
                source_title="This House Believes that the War in Iraq was Worth the Cost | idebate.org",
                source_url="https://idebate.org/debatabase/international-middle-east-politics-terrorism-warpeace/house-believes-war-iraq-was-worth",
                source_previous_argument_id=None,
                source_next_argument_id=None,
                source_domain=ArgsMeSourceDomain.idebate,
                source_text=compile("idebate.org Educational and informative news and .{17542} Facebook Login with Twitter "),
                source_text_conclusion_start=196,
                source_text_conclusion_end=230,
                source_text_premise_start=8137,
                source_text_premise_end=8234,
                topic="the War in Iraq was Worth the Cost",
                acquisition=datetime.fromisoformat("2019-04-19T12:40:25+00:00"),
                date=None,
                author=None,
                author_image_url=None,
                author_organization=None,
                author_role=None,
                mode=ArgsMeMode.discussion,
                sentences=[
                    ArgsMeSentence(
                        id="Sf9294c83-Af186e851__PREMISE__1",
                        text="His removal provides stability and security not only for Iraq but for the Middle East as a region"
                    ),
                    ArgsMeSentence(
                        id="Sf9294c83-Af186e851__CONC__1",
                        text="the War in Iraq was Worth the Cost"
                    )
                ],
            ),
            365407: ArgsMeProcessedDoc(
                doc_id="S148bb110-A119d66b0",
                conclusion="Environmental impact of barages is ugly.",
                premises=[
                    ArgsMePremise(
                        text=compile("Barages are fairly massive objects, like .{190} property values and tourism."),
                        stance=ArgsMeStance.PRO,
                        annotations=[]
                    )
                ],
                premises_texts=compile("Barages are fairly massive objects, like .{190} property values and tourism."),
                aspects=[],
                aspects_names="",
                source_id="S148bb110",
                source_title="Debate: Tidal energy - Debatepedia",
                source_url="http://www.debatepedia.org/en/index.php/Debate:_Tidal_energy",
                source_previous_argument_id=None,
                source_next_argument_id=None,
                source_domain=ArgsMeSourceDomain.debatepedia,
                source_text=compile("Welcome to Debatepedia! \| About \| Help \| FAQ \| Media Kit Personal .{28131} with the site\?\xa0 Edit Close . "),
                source_text_conclusion_start=22030,
                source_text_conclusion_end=22070,
                source_text_premise_start=22070,
                source_text_premise_end=22331,
                topic="Tidal energy",
                acquisition=datetime.fromisoformat("2019-04-17T11:47:38+00:00"),
                date=None,
                author=None,
                author_image_url=None,
                author_organization=None,
                author_role=None,
                mode=ArgsMeMode.discussion,
                sentences=[
                    ArgsMeSentence(
                        id="S148bb110-A119d66b0__PREMISE__1",
                        text="Barages are fairly massive objects, like Dams, that obstruct the natural flow of water and can, subsequently, have harmful environmental impacts."
                    ),
                    ArgsMeSentence(
                        id="S148bb110-A119d66b0__PREMISE__2",
                        text="These effects can be very ugly, causing frustration among locals and possibly reduced property values and tourism."
                    ), ArgsMeSentence(
                        id="S148bb110-A119d66b0__CONC__1",
                        text="Environmental impact of barages is ugly."
                    )
                ]
                ,
            ),
        })


if __name__ == "__main__":
    main()
