File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ def test_download(self):
69
69
_ , filename = tempfile .mkstemp ()
70
70
asset .download (filename )
71
71
72
- with open (filename ) as fd :
72
+ with open (filename , 'rb' ) as fd :
73
73
assert len (fd .read (1024 )) > 0
74
74
75
75
os .unlink (filename )
Original file line number Diff line number Diff line change 2
2
3
3
from .helper import UnitHelper
4
4
5
+ import json
6
+
5
7
6
8
def releases_url (path = '' ):
7
9
url = "https://api.github.com/repos/octocat/Hello-World/releases"
@@ -64,8 +66,10 @@ def test_edit_without_label(self):
64
66
65
67
def test_edit_with_label (self ):
66
68
self .instance .edit ('new name' , 'label' )
67
- self .session .patch .assert_called_once_with (
68
- self .example_data ['url' ],
69
- data = '{"name": "new name", "label": "label"}' ,
70
- headers = {'Accept' : 'application/vnd.github.manifold-preview' }
71
- )
69
+ headers = {'Accept' : 'application/vnd.github.manifold-preview' }
70
+ _ , args , kwargs = list (self .session .patch .mock_calls [0 ])
71
+ assert self .example_data ['url' ] in args
72
+ assert kwargs ['headers' ] == headers
73
+ assert json .loads (kwargs ['data' ]) == {
74
+ 'name' : 'new name' , 'label' : 'label'
75
+ }
You can’t perform that action at this time.
0 commit comments