<commit_before>import datetime

import pynvest_connect.yahoo


class TestHistoricalPrices(object):
    def test_single_date(self):
        prices = pynvest_connect.yahoo.historical_prices('KO', start_date=datetime.date(2012, 3, 12), end_date=datetime.date(2012, 3, 12))

        assert len(prices) == 1
        assert prices[0].date == datetime.date(2012, 3, 12)
        assert prices[0].close * 100 == 7015

    def test_multiple_dates_in_reverse_order(self):
        prices = pynvest_connect.yahoo.historical_prices('KO', start_date=datetime.date(2012, 3, 12), end_date=datetime.date(2012, 3, 14))

        assert len(prices) == 3
        assert prices[0].date == datetime.date(2012, 3, 14)
        assert prices[1].date == datetime.date(2012, 3, 13)
        assert prices[2].date == datetime.date(2012, 3, 12)

    def test_ignore_missing_dates(self):
        prices = pynvest_connect.yahoo.historical_prices('KO', start_date=datetime.date(2012, 3, 9), end_date=datetime.date(2012, 3, 12))

        assert len(prices) == 2
        assert prices[0].date == datetime.date(2012, 3, 12)
        assert prices[1].date == datetime.date(2012, 3, 9)

    def test_funny_symbols(self):
        prices = pynvest_connect.yahoo.historical_prices('BRK.B', start_date=datetime.date(2012, 3, 12), end_date=datetime.date(2012, 3, 12))

        assert len(prices) == 1
        assert prices[0].date == datetime.date(2012, 3, 12)
        assert prices[0].close * 100 == 7954


class TestDividends(object):<commit_msg>Marked test as failing<commit_after>import pytest
import datetime

import pynvest_connect.yahoo


class TestHistoricalPrices(object):
    def test_single_date(self):
        prices = pynvest_connect.yahoo.historical_prices('KO', start_date=datetime.date(2012, 3, 12), end_date=datetime.date(2012, 3, 12))

        assert len(prices) == 1
        assert prices[0].date == datetime.date(2012, 3, 12)
        assert prices[0].close * 100 == 7015

    def test_multiple_dates_in_reverse_order(self):
        prices = pynvest_connect.yahoo.historical_prices('KO', start_date=datetime.date(2012, 3, 12), end_date=datetime.date(2012, 3, 14))

        assert len(prices) == 3
        assert prices[0].date == datetime.date(2012, 3, 14)
        assert prices[1].date == datetime.date(2012, 3, 13)
        assert prices[2].date == datetime.date(2012, 3, 12)

    def test_ignore_missing_dates(self):
        prices = pynvest_connect.yahoo.historical_prices('KO', start_date=datetime.date(2012, 3, 9), end_date=datetime.date(2012, 3, 12))

        assert len(prices) == 2
        assert prices[0].date == datetime.date(2012, 3, 12)
        assert prices[1].date == datetime.date(2012, 3, 9)

    def test_funny_symbols(self):
        prices = pynvest_connect.yahoo.historical_prices('BRK.B', start_date=datetime.date(2012, 3, 12), end_date=datetime.date(2012, 3, 12))

        assert len(prices) == 1
        assert prices[0].date == datetime.date(2012, 3, 12)
        assert prices[0].close * 100 == 7954


class TestDividends(object):
    @pytest.mark.xfail
    # Yahoo has adjusted dividends
{'fraction_non_alphanumeric': 0.13419773095623988, 'fraction_numerical': 0.08427876823338736, 'mean_word_length': 3.675757575757576, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3728625', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1013, 'n_words': 215}