|
1 | 1 | from github3.github import GitHubEnterprise
|
2 | 2 | import github3
|
3 | 3 |
|
4 |
| -from .helper import UnitHelper |
5 |
| - |
6 |
| -example_data = { |
7 |
| - "login": "octocat", |
8 |
| - "id": 1, |
9 |
| - "avatar_url": "https://github.com/images/error/octocat_happy.gif", |
10 |
| - "gravatar_id": "somehexcode", |
11 |
| - "url": "https://api.github.com/users/octocat", |
12 |
| - "html_url": "https://github.com/octocat", |
13 |
| - "followers_url": "https://api.github.com/users/octocat/followers", |
14 |
| - "following_url": ("https://api.github.com/users/octocat/following" |
15 |
| - "{/other_user}"), |
16 |
| - "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", |
17 |
| - "starred_url": ("https://api.github.com/users/octocat/starred" |
18 |
| - "{/owner}{/repo}"), |
19 |
| - "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", |
20 |
| - "organizations_url": "https://api.github.com/users/octocat/orgs", |
21 |
| - "repos_url": "https://api.github.com/users/octocat/repos", |
22 |
| - "events_url": "https://api.github.com/users/octocat/events{/privacy}", |
23 |
| - "received_events_url": ("https://api.github.com/users/octocat/" |
24 |
| - "received_events"), |
25 |
| - "type": "User", |
26 |
| - "site_admin": False, |
27 |
| - "name": "monalisa octocat", |
28 |
| - "company": "GitHub", |
29 |
| - "blog": "https://github.com/blog", |
30 |
| - "location": "San Francisco", |
31 |
| - "email": "octocat@github.com", |
32 |
| - "hireable": False, |
33 |
| - "bio": "There once was...", |
34 |
| - "public_repos": 2, |
35 |
| - "public_gists": 1, |
36 |
| - "followers": 20, |
37 |
| - "following": 0, |
38 |
| - "created_at": "2008-01-14T04:33:35Z", |
39 |
| - "updated_at": "2008-01-14T04:33:35Z" |
40 |
| -} |
| 4 | +from .helper import UnitHelper, create_example_data_helper |
| 5 | + |
| 6 | +get_example_user = create_example_data_helper('user_example') |
| 7 | + |
| 8 | +example_data = get_example_user() |
41 | 9 |
|
42 | 10 | base_url = 'https://ghe.example.com/'
|
43 | 11 |
|
@@ -76,7 +44,7 @@ def test_create_user(self):
|
76 | 44 |
|
77 | 45 | class TestUserAdministration(UnitHelper):
|
78 | 46 | described_class = github3.users.User
|
79 |
| - example_data = example_data.copy() |
| 47 | + example_data = example_data |
80 | 48 | # Remove the end of the string starting with 'users'
|
81 | 49 | base_url = example_data['url'][:example_data['url'].rfind('users')]
|
82 | 50 |
|
|
0 commit comments