File: test_follow_requests.py

package info (click to toggle)
python-mastodon 2.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,836 kB
  • sloc: python: 9,438; makefile: 206; sql: 98; sh: 27
file content (27 lines) | stat: -rw-r--r-- 646 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import pytest
import time

@pytest.mark.vcr()
def test_follow_requests(api):
    reqs = api.follow_requests()
    assert isinstance(reqs, list)


@pytest.mark.vcr()
def test_follow_request_authorize(api, api2):
    api_id = api.account_verify_credentials()
    api2.account_follow(api_id)
    time.sleep(2)
    request = api.follow_requests()[0]
    api.follow_request_authorize(request)
    api2.account_unfollow(api_id)


@pytest.mark.vcr()
def test_follow_request_reject(api, api2):
    api2.account_follow(api.account_verify_credentials())
    time.sleep(2)
    request = api.follow_requests()[0]    
    api.follow_request_reject(request)