Exemple #1
0
 def test_load_from_fake_client(self):
     fake_client = FakeClient.from_file("usc.json")
     filepath = filepaths.make_filepath(filename="holding_mazza_alaluf.yaml")
     result = read_anchored_holdings_from_file(filepath=filepath, client=fake_client)
     key = "the fact it was false that <Turismo Costa Brava> was a domestic financial institution"
     anchors = result.get_term_anchors(key)
     assert anchors.quotes[0].exact.startswith(
         "without respect to whether or not Turismo"
     )
     assert len(result.holdings) == 2
Exemple #2
0
    def test_multiple_non_Factor_selectors_for_Holding(self):
        """
        The Holding-level TextQuoteSelectors should be built from this:

        "text": [
            "Census data therefore do not|trigger|copyright",
            "|may|possess the requisite originality"
            ]
        """
        client = FakeClient.from_file("usc.json")
        holdings = loaders.read_anchored_holdings_from_file(
            "holding_feist.yaml", client=client)
        assert len(holdings.holdings[6].anchors.quotes) == 2
Exemple #3
0
class TestLoadAndReadFake:
    client = FakeClient.from_file("usc.json")

    @pytest.mark.vcr
    def test_read_holdings_from_file(self):
        oracle_holdings = read_holdings_from_file(
            "holding_oracle.yaml", client=self.client
        )
        assert oracle_holdings[0]

    def test_read_holdings_in_nested_rule(self):
        watt_holdings = read_holdings_from_file("holding_watt.yaml", client=self.client)
        assert watt_holdings[4].inputs[0].terms[0].name == "Hideaway Lodge"