Esempio n. 1
0
    def test_posit_anchored_holdings(self, make_response):
        client = FakeClient(responses=make_response)

        oracle_dict = load_decision("oracle_h.json")
        lotus_dict = load_decision("lotus_h.json")
        oracle = Decision(**oracle_dict)
        lotus = Decision(**lotus_dict)

        oracle_ah = read_anchored_holdings_from_file("holding_oracle.yaml",
                                                     client=client)
        lotus_ah = read_anchored_holdings_from_file("holding_lotus.yaml",
                                                    client=client)

        oracle_reading = DecisionReading(decision=oracle)
        lotus_reading = DecisionReading(decision=lotus)

        oracle_reading.posit(
            holdings=oracle_ah.holdings,
            named_anchors=oracle_ah.named_anchors,
            enactment_anchors=oracle_ah.enactment_anchors,
        )
        lotus_reading.posit(
            holdings=lotus_ah.holdings,
            named_anchors=lotus_ah.named_anchors,
            enactment_anchors=lotus_ah.enactment_anchors,
        )

        assert lotus_reading.contradicts(oracle_reading)
Esempio n. 2
0
 def test_passage_from_imported_statute(self, fake_usc_client):
     oracle = loaders.load_decision("oracle_h.json")
     oracle_decision = Decision(**oracle)
     reading = DecisionReading(decision=oracle_decision)
     loaded = loaders.load_holdings("holding_oracle.yaml")
     holdings = readers.read_holdings(loaded, client=fake_usc_client)
     reading.posit(holdings)
     despite_text = str(list(reading.holdings)[5])
     assert "In no case does copyright protection " in despite_text
Esempio n. 3
0
 def test_download_save_and_make_opinion(self, tmp_path):
     to_file = "lotus_h.json"
     lotus_from_api = self.client.read_cite(cite="49 F.3d 807",
                                            full_case=True)
     writers.case_to_file(case=lotus_from_api,
                          filename=to_file,
                          directory=tmp_path)
     filepath = tmp_path / to_file
     lotus_from_file = load_decision(filepath=filepath)
     lotus = Decision(**lotus_from_file)
     assert lotus.majority.__class__.__name__ == "Opinion"
     assert "Lotus" in lotus.name_abbreviation
Esempio n. 4
0
 def test_load_opinion(self):
     brad_dict = loaders.load_decision("brad_h.json")
     dissent = brad_dict["casebody"]["data"]["opinions"][1]
     opinion = Opinion(**dissent)
     assert opinion.type == "concurring-in-part-and-dissenting-in-part"
Esempio n. 5
0
 def test_load_opinion_in_CAP_format(self):
     watt_dict = loaders.load_decision("watt_h.json")
     assert watt_dict["name_abbreviation"] == "Wattenburg v. United States"
Esempio n. 6
0
 def test_load_decision(self):
     brad_dict = loaders.load_decision("brad_h.json")
     brad = readers.read_decision(brad_dict)
     dissent = brad.opinions[1]
     assert dissent.type == "concurring-in-part-and-dissenting-in-part"
Esempio n. 7
0
 def test_load_opinion(self):
     schema = schemas.OpinionSchema(many=False)
     brad_dict = loaders.load_decision("brad_h.json")
     dissent = brad_dict["casebody"]["data"]["opinions"][1]
     opinion = schema.load(dissent)
     assert opinion.position == "concurring-in-part-and-dissenting-in-part"