Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitce16412

Browse files
committed
Add a way around setting up self.gh
Integration tests should not always rely on a new object. They shouldoccasionally use the public API.
1 parent96936a3 commitce16412

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

‎tests/integration/helper.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ def setUp(self):
99
self.user=os.environ.get('GH_USER','foo')
1010
self.password=os.environ.get('GH_PASSWORD','bar')
1111
self.token=os.environ.get('GH_AUTH','x'*20)
12-
self.gh=github3.GitHub()
12+
self.gh=self.get_client()
1313
self.session=self.gh._session
1414
self.recorder=betamax.Betamax(self.session)
1515

16+
defget_client(self):
17+
returngithub3.GitHub()
18+
1619
deftoken_login(self):
1720
self.gh.login(token=self.token)
1821

‎tests/integration/test_api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55

66
classTestAPI(IntegrationHelper):
7+
defget_client(self):
8+
returngithub3.gh
9+
710
deftest_search_repositories(self):
811
"""Test the ability to use the repository search endpoint"""
912
cassette_name=self.cassette_name('search_repositories',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp