def test_lists_memberships_iter(samp_auth):
    """
    Test the lists/memberships method using cursor_iter.
    """

    for user_id, screen_name in TEST_USERS:
        params = {"user_id": user_id, "count": 10, "maxitems": 20}
        results = []
        for data, meta in rest.lists_memberships(samp_auth, **params):
            assert meta["code"] == 200
            assert "lists" in data
            results.extend(data["lists"])
        assert all("member_count" in l for l in results)
        assert all("subscriber_count" in l for l in results)
        assert len(results) >= 20
        assert len(set(r["id"] for r in results)) >= 20

        params = {"screen_name": screen_name, "count": 10, "maxitems": 20}
        results = []
        for data, meta in rest.lists_memberships(samp_auth, **params):
            assert meta["code"] == 200
            assert "lists" in data
            results.extend(data["lists"])
        assert all("member_count" in l for l in results)
        assert all("subscriber_count" in l for l in results)
        assert len(results) >= 20
        assert len(set(r["id"] for r in results)) >= 20
Beispiel #2
0
def test_lists_memberships_iter(samp_auth):
    """
    Test the lists/memberships method using cursor_iter.
    """

    for user_id, screen_name in TEST_USERS:
        params = {"user_id": user_id, "count": 10, "maxitems": 20}
        results = []
        for data, meta in rest.lists_memberships(samp_auth, **params):
            assert meta["code"] == 200
            assert "lists" in data
            results.extend(data["lists"])
        assert all("member_count" in l for l in results)
        assert all("subscriber_count" in l for l in results)
        assert len(results) >= 20
        assert len(set(r["id"] for r in results)) >= 20

        params = {"screen_name": screen_name, "count": 10, "maxitems": 20}
        results = []
        for data, meta in rest.lists_memberships(samp_auth, **params):
            assert meta["code"] == 200
            assert "lists" in data
            results.extend(data["lists"])
        assert all("member_count" in l for l in results)
        assert all("subscriber_count" in l for l in results)
        assert len(results) >= 20
        assert len(set(r["id"] for r in results)) >= 20
def test_lists_memberships(samp_auth):
    """
    Test the lists/memberships method.
    """

    for user_id, screen_name in TEST_USERS:
        params = {"user_id": user_id, "count": 10}
        data, meta = rest.lists_memberships(samp_auth, **params)
        assert meta["code"] == 200
        assert "lists" in data
        assert all("member_count" in l for l in data["lists"])
        assert all("subscriber_count" in l for l in data["lists"])

        params = {"screen_name": screen_name, "count": 10}
        data, meta = rest.lists_memberships(samp_auth, **params)
        assert meta["code"] == 200
        assert "lists" in data
        assert all("member_count" in l for l in data["lists"])
        assert all("subscriber_count" in l for l in data["lists"])
Beispiel #4
0
def test_lists_memberships(samp_auth):
    """
    Test the lists/memberships method.
    """

    for user_id, screen_name in TEST_USERS:
        params = {"user_id": user_id, "count": 10}
        data, meta = rest.lists_memberships(samp_auth, **params)
        assert meta["code"] == 200
        assert "lists" in data
        assert all("member_count" in l for l in data["lists"])
        assert all("subscriber_count" in l for l in data["lists"])

        params = {"screen_name": screen_name, "count": 10}
        data, meta = rest.lists_memberships(samp_auth, **params)
        assert meta["code"] == 200
        assert "lists" in data
        assert all("member_count" in l for l in data["lists"])
        assert all("subscriber_count" in l for l in data["lists"])