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

Commit323482a

Browse files
committed
Add integration tests for public search API
- Allow IntegrationHelper.cassette_name to take a class name for the cassette generation
1 parent35dc15e commit323482a

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

‎tests/integration/helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ def token_login(self):
1919
defbasic_login(self):
2020
self.gh.login(self.user,self.password)
2121

22-
defcassette_name(self,method):
23-
class_name=self.described_class
22+
defcassette_name(self,method,cls=None):
23+
class_name=clsorself.described_class
2424
return'_'.join([class_name,method])
2525

2626
@property

‎tests/integration/test_api.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
importgithub3
2+
3+
from .helperimportIntegrationHelper
4+
5+
6+
classTestAPI(IntegrationHelper):
7+
deftest_search_repositories(self):
8+
"""Test the ability to use the repository search endpoint"""
9+
cassette_name=self.cassette_name('search_repositories',
10+
cls='GitHub')
11+
withself.recorder.use_cassette(cassette_name):
12+
repos=self.gh.search_repositories('github3 language:python')
13+
assertisinstance(next(repos),github3.repos.repo.Repository)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp