Exemplo n.º 1
0
def test_favorites_list(samp_auth):
    """
    Test the favorites/list method.
    """

    for user_id, screen_name in TEST_USERS:
        params = {"user_id": user_id, "count": 10}
        tweets, meta = rest.favorites_list(samp_auth, **params)
        assert meta["code"] == 200
        assert all("id" in t for t in tweets)
        assert all("text" in t for t in tweets)

        params = {"screen_name": screen_name, "count": 10}
        tweets, meta = rest.favorites_list(samp_auth, **params)
        assert meta["code"] == 200
        assert all("id" in t for t in tweets)
        assert all("text" in t for t in tweets)
Exemplo n.º 2
0
def test_favorites_list(samp_auth):
    """
    Test the favorites/list method.
    """

    for user_id, screen_name in TEST_USERS:
        params = {"user_id": user_id, "count": 10}
        tweets, meta = rest.favorites_list(samp_auth, **params)
        assert meta["code"] == 200
        assert all("id" in t for t in tweets)
        assert all("text" in t for t in tweets)

        params = {"screen_name": screen_name, "count": 10}
        tweets, meta = rest.favorites_list(samp_auth, **params)
        assert meta["code"] == 200
        assert all("id" in t for t in tweets)
        assert all("text" in t for t in tweets)
Exemplo n.º 3
0
def test_favorites_list_iter(samp_auth):
    """
    Test the favorites_list method using id_iter.
    """

    for user_id, _ in TEST_USERS:
        params = {"user_id": user_id, "count": 10, "maxitems": 20}
        results = []
        for tweets, meta in rest.favorites_list(samp_auth, **params):
            assert meta["code"] == 200
            results.extend(tweets)
        assert all("id" in t for t in results)
        assert all("text" in t for t in results)
        assert len(results) >= 20
        assert len(set(r["id"] for r in results)) >= 20
Exemplo n.º 4
0
def test_favorites_list_iter(samp_auth):
    """
    Test the favorites_list method using id_iter.
    """

    for user_id, _ in TEST_USERS:
        params = {"user_id": user_id, "count": 10, "maxitems": 20}
        results = []
        for tweets, meta in rest.favorites_list(samp_auth, **params):
            assert meta["code"] == 200
            results.extend(tweets)
        assert all("id" in t for t in results)
        assert all("text" in t for t in results)
        assert len(results) >= 20
        assert len(set(r["id"] for r in results)) >= 20