Skip to content

Commit

Permalink
test holdings param to DecisionReading constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
mscarey committed Jul 28, 2021
1 parent 610595b commit 2228d63
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/io/test_holding.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from nettlesome.entities import Entity
from nettlesome.predicates import Predicate

from authorityspoke.decisions import DecisionReading
from authorityspoke.facts import Fact
from authorityspoke.holdings import Holding, HoldingGroup
from authorityspoke.opinions import Opinion, OpinionReading
Expand Down Expand Up @@ -228,6 +229,20 @@ def test_load_and_posit_holdings_with_anchors(self, make_opinion, make_response)
reading.posit(oracle_holdings_with_anchors)
assert len(reading.holdings) == 20

def test_pass_holdings_to_decision_reading_constructor(
self, make_decision, make_response
):
mock_client = FakeClient(responses=make_response)
oracle = make_decision["oracle"]
oracle_holdings = read_holdings_from_file(
"holding_oracle.yaml", client=mock_client
)
oracle_reading = DecisionReading(decision=oracle, holdings=oracle_holdings)
assert (
oracle_reading.opinion_readings[0].holdings[0].enactments[0].node
== "/us/const/article/I/8/8"
)


class TestTextAnchors:
client = Client(api_token=TOKEN)
Expand Down

0 comments on commit 2228d63

Please sign in to comment.