File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ class Gist(GitHubCore):
21
21
you own it). You can also "star" or "unstar" the gist (again assuming you
22
22
have authenticated).
23
23
"""
24
-
25
24
def __init__ (self , data , session = None ):
26
25
super (Gist , self ).__init__ (data , session )
27
26
#: Number of comments on this gist
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ def __repr__(self):
31
31
def __str__ (self ):
32
32
return self .key
33
33
34
+ def __eq__ (self , other ):
35
+ return self .id == other .id
36
+
34
37
def _update_ (self , key ):
35
38
self .__init__ (key , self ._session )
36
39
Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ def setUp(self):
14
14
super (TestKey , self ).setUp ()
15
15
self .key = github3 .users .Key (self .key .to_json (), self .g )
16
16
17
+ def test_equality (self ):
18
+ expect (self .key ) == github3 .users .Key (self .key .to_json ())
19
+
17
20
def test_str (self ):
18
21
expect (str (self .key )) == self .key .key
19
22
expect (repr (self .key ).startswith ('<User Key' )).is_True ()
You can’t perform that action at this time.
0 commit comments