File tree Expand file tree Collapse file tree 4 files changed +42
-0
lines changed Expand file tree Collapse file tree 4 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ Unreleased
6
6
- Add ``Organization#all_events ``.
7
7
- Deprecate ``Organization#events `` in favor of ``Organization#public_events ``.
8
8
- Fix test failtures on windows caused by unclosed file handles.
9
+ - Add ``Tag.tagger_as_User `` which attempts to return the tagger as as User.
9
10
10
11
1.0.0a4: 2016-02-19
11
12
~~~~~~~~~~~~~~~~~~~
Original file line number Diff line number Diff line change @@ -195,6 +195,14 @@ def _update_attributes(self, tag):
195
195
def _repr (self ):
196
196
return '<Tag [{0}]>' .format (self .tag )
197
197
198
+ def tagger_as_User (self ):
199
+ """Attempt to return the tagger attribute as a
200
+ :class:`User <github3.users.User>`. No guarantees are made about the
201
+ validity of this object, i.e., having a login or created_at object.
202
+
203
+ """
204
+ return User (self .tagger , self )
205
+
198
206
199
207
class Tree (GitData ):
200
208
Original file line number Diff line number Diff line change
1
+ {
2
+ "tag": "v0.0.1",
3
+ "sha": "940bd336248efae0f9ee5bc7b2d5c985887b16ac",
4
+ "url": "https://api.github.com/repos/octocat/Hello-World/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac",
5
+ "message": "initial version\n",
6
+ "tagger": {
7
+ "name": "Scott Chacon",
8
+ "email": "schacon@gmail.com",
9
+ "date": "2014-11-07T22:01:45Z"
10
+ },
11
+ "object": {
12
+ "type": "commit",
13
+ "sha": "c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c",
14
+ "url": "https://api.github.com/repos/octocat/Hello-World/git/commits/c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c"
15
+ }
16
+ }
Original file line number Diff line number Diff line change 11
11
'git/refs/heads/featureA' )
12
12
13
13
get_commit_example_data = create_example_data_helper ('commit_example' )
14
+ get_git_tag_example_data = create_example_data_helper ('git_tag_example' )
14
15
get_reference_example_data = create_example_data_helper ('reference_example' )
15
16
16
17
@@ -66,6 +67,22 @@ def test_author_as_User(self):
66
67
assert isinstance (user , github3 .users .User )
67
68
68
69
70
+ class TestGitTag (UnitHelper ):
71
+
72
+ """Git Tag unit test."""
73
+
74
+ described_class = github3 .git .Tag
75
+ example_data = get_git_tag_example_data ()
76
+
77
+ def test_repr (self ):
78
+ assert repr (self .instance ).startswith ('<Tag' )
79
+
80
+ def test_tagger_as_User (self ):
81
+ """Show that tagger_as_User() returns instance of User."""
82
+ user = self .instance .tagger_as_User ()
83
+ assert isinstance (user , github3 .users .User )
84
+
85
+
69
86
class TestReference (UnitHelper ):
70
87
71
88
"""Reference unit test."""
You can’t perform that action at this time.
0 commit comments