File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ import github3
2
+ import datetime
3
+
4
+ from .helper import (UnitHelper , create_example_data_helper , create_url_helper )
5
+
6
+ get_notification_example_data = create_example_data_helper ('notification_example' )
7
+ url_for = create_url_helper (
8
+ 'https://api.github.com/notifications/threads/6169361'
9
+ )
10
+
11
+
12
+ class TestThread (UnitHelper ):
13
+ """Notification unit tests."""
14
+
15
+ described_class = github3 .notifications .Thread
16
+ example_data = get_notification_example_data ()
17
+
18
+ def test_last_read_at (self ):
19
+ json = self .instance .as_dict ().copy ()
20
+ json ['last_read_at' ] = '2013-12-31T23:59:59Z'
21
+ thread = github3 .notifications .Thread (json )
22
+ assert isinstance (thread .last_read_at , datetime .datetime )
23
+
24
+ def test_repr (self ):
25
+ assert repr (self .instance ) == '<Thread [{0}]>' .format (
26
+ self .instance .subject .get ('title' ))
27
+
28
+ def test_delete_description (self ):
29
+ self .instance .delete_subscription ()
30
+
31
+ self .session .delete .assert_called_once_with (url_for ('subscription' ))
You can’t perform that action at this time.
0 commit comments