import pandas as pd

from huginn import articles


def test__timestamp_to_string():
    ts = pd.Timestamp('20200225')
    assert articles._timestamp_to_string(ts) == '20200225'


def test_get_api_key():
    api_key = articles.get_api_key()
    assert type(api_key) == str


def test__get_sections():
    sections = articles._get_sections()

    assert type(sections) == str
    assert "&" not in sections


def test_get_links():
    date = pd.Timestamp('20180212')
    keyword = 'Point72'

    one_link_list = articles.get_article_urls(keyword, date, num_links=1)
    link = one_link_list[0]

    five_link_list = articles.get_article_urls(keyword, date, num_links=5)

    assert type(one_link_list) == list

    assert len(one_link_list) == 1

    assert len(five_link_list) == 5

    assert 'www.nytimes.com' in link

464152bcbf8aa375c4c3a0e557a1513f40b7863e
<mask token>


def test__get_sections():
    sections = articles._get_sections()
    assert type(sections) == str
    assert '&' not in sections


<mask token>

<mask token>


def test__timestamp_to_string():
    ts = pd.Timestamp('20200225')
    assert articles._timestamp_to_string(ts) == '20200225'


<mask token>


def test__get_sections():
    sections = articles._get_sections()
    assert type(sections) == str
    assert '&' not in sections


def test_get_links():
    date = pd.Timestamp('20180212')
    keyword = 'Point72'
    one_link_list = articles.get_article_urls(keyword, date, num_links=1)
    link = one_link_list[0]
    five_link_list = articles.get_article_urls(keyword, date, num_links=5)
    assert type(one_link_list) == list
    assert len(one_link_list) == 1
    assert len(five_link_list) == 5
    assert 'www.nytimes.com' in link

<mask token>


def test__timestamp_to_string():
    ts = pd.Timestamp('20200225')
    assert articles._timestamp_to_string(ts) == '20200225'


def test_get_api_key():
    api_key = articles.get_api_key()
    assert type(api_key) == str


def test__get_sections():
    sections = articles._get_sections()
    assert type(sections) == str
    assert '&' not in sections


def test_get_links():
    date = pd.Timestamp('20180212')
    keyword = 'Point72'
    one_link_list = articles.get_article_urls(keyword, date, num_links=1)
    link = one_link_list[0]
    five_link_list = articles.get_article_urls(keyword, date, num_links=5)
    assert type(one_link_list) == list
    assert len(one_link_list) == 1
    assert len(five_link_list) == 5
    assert 'www.nytimes.com' in link

import pandas as pd
from huginn import articles


def test__timestamp_to_string():
    ts = pd.Timestamp('20200225')
    assert articles._timestamp_to_string(ts) == '20200225'


def test_get_api_key():
    api_key = articles.get_api_key()
    assert type(api_key) == str


def test__get_sections():
    sections = articles._get_sections()
    assert type(sections) == str
    assert '&' not in sections


def test_get_links():
    date = pd.Timestamp('20180212')
    keyword = 'Point72'
    one_link_list = articles.get_article_urls(keyword, date, num_links=1)
    link = one_link_list[0]
    five_link_list = articles.get_article_urls(keyword, date, num_links=5)
    assert type(one_link_list) == list
    assert len(one_link_list) == 1
    assert len(five_link_list) == 5
    assert 'www.nytimes.com' in link

import pandas as pd

from huginn import articles


def test__timestamp_to_string():
    ts = pd.Timestamp('20200225')
    assert articles._timestamp_to_string(ts) == '20200225'


def test_get_api_key():
    api_key = articles.get_api_key()
    assert type(api_key) == str


def test__get_sections():
    sections = articles._get_sections()

    assert type(sections) == str
    assert "&" not in sections


def test_get_links():
    date = pd.Timestamp('20180212')
    keyword = 'Point72'

    one_link_list = articles.get_article_urls(keyword, date, num_links=1)
    link = one_link_list[0]

    five_link_list = articles.get_article_urls(keyword, date, num_links=5)

    assert type(one_link_list) == list

    assert len(one_link_list) == 1

    assert len(five_link_list) == 5

    assert 'www.nytimes.com' in link
