Exemplo n.º 1
0
def test_index_page():
    url = "/topics"
    topics = Topics(url)
    print("----url----",topics.url)
    res = topics.get_index_topics()
    r = res.json()
    assert len(r['data']) == 20
    assert res.status_code == 200
    
Exemplo n.º 2
0
def test_index_page(limit, tab):
    url = "/topics"
    topics = Topics(url)
    print("-----------", topics.url)
    res = topics.get_index_topics(limit, tab)
    r = res.json()
    assert len(r['data']) == limit
    assert r['success'] == True
    assert res.status_code == 200
    all_data = r["data"]
    for data in all_data:
        assert data["tab"] == tab
Exemplo n.º 3
0
def test_index_page(limit, tab):
    url = "/topics"
    topics = Topics(url)
    # assert_limit=1
    # tab = 'ask'
    res = topics.get_index_topics(limit, tab)
    r = res.json()
    assert len(r['data']) == int(limit)
    # r['data'][0]['tab'] == 'ask'
    assert res.status_code == 200
    all_data = r['data']
    for data in all_data:
        assert data['tab'] == tab