forked from sigmavirus24/github3.py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_session.py
More file actions
21 lines (16 loc) · 774 Bytes
/
Copy pathtest_session.py
File metadata and controls
21 lines (16 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import github3
from .helper import IntegrationHelper
class TestGitHubSession(IntegrationHelper):
def test_two_factor_authentication_works(self):
def _two_factor_auth():
return '862478'
two_factor_auth = _two_factor_auth
self.basic_login()
self.gh.login(two_factor_callback=two_factor_auth)
cassette_name = self.cassette_name('two_factor_authentication')
assert isinstance(self.session, github3.session.GitHubSession)
match = ['method', 'uri', 'gh3-headers']
with self.recorder.use_cassette(cassette_name,
match_requests_on=match):
r = self.session.get('https://api.github.com/users/sigmavirus24')
assert r.status_code == 200