|
6 | 6 | from base64 import b64encode
|
7 | 7 | from github3 import GitHubError
|
8 | 8 | from github3.null import NullObject
|
| 9 | +from github3.repos.release import Asset |
9 | 10 | from github3.repos.repo import (Comparison, Contents, Hook, RepoComment,
|
10 | 11 | RepoCommit, Repository)
|
11 | 12 | from github3.models import GitHubCore
|
12 | 13 |
|
13 | 14 | from . import helper
|
14 | 15 |
|
| 16 | +asset_url_for = helper.create_url_helper( |
| 17 | + 'https://api.github.com/repos/octocat/Hello-World/releases/assets/1' |
| 18 | +) |
15 | 19 | comment_url_for = helper.create_url_helper(
|
16 | 20 | 'https://api.github.com/repos/octocat/Hello-World/comments/1'
|
17 | 21 | )
|
|
32 | 36 | 'https://api.github.com/repos/octocat/Hello-World'
|
33 | 37 | )
|
34 | 38 |
|
| 39 | +get_asset_example_data = helper.create_example_data_helper( |
| 40 | + 'asset_example' |
| 41 | +) |
35 | 42 | get_repo_example_data = helper.create_example_data_helper(
|
36 | 43 | 'repos_repo_example'
|
37 | 44 | )
|
|
53 | 60 | create_file_contents_example_data = helper.create_example_data_helper(
|
54 | 61 | 'create_file_contents_example'
|
55 | 62 | )
|
| 63 | +asset_example_data = get_asset_example_data() |
56 | 64 | comment_example_data = get_comment_example_data()
|
57 | 65 | commit_example_data = get_commit_example_data()
|
58 | 66 | compare_example_data = get_compare_example_data()
|
@@ -1864,3 +1872,15 @@ def test_patch(self):
|
1864 | 1872 | def test_str(self):
|
1865 | 1873 | """Show that instance string is formatted correctly."""
|
1866 | 1874 | assert str(self.instance).startswith('<Comparison')
|
| 1875 | + |
| 1876 | + |
| 1877 | +class TestAsset(helper.UnitHelper): |
| 1878 | + |
| 1879 | + """Unit test for Asset object.""" |
| 1880 | + |
| 1881 | + described_class = Asset |
| 1882 | + example_data = asset_example_data |
| 1883 | + |
| 1884 | + def test_str(self): |
| 1885 | + """Show that instance string is formatted correctly.""" |
| 1886 | + assert str(self.instance).startswith('<Asset ') |
0 commit comments