Skip to content

Commit ea6f490

Browse files
author
Armin Samii
committed
Add a regression test for a files.info request
1 parent 9639eb3 commit ea6f490

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_slackrequest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ def test_post_file(mocker):
1717
'token': 'xoxb-123'} == kwargs['data']
1818
assert None != kwargs['files']
1919

20+
def test_get_file(mocker):
21+
requests = mocker.patch('slackclient._slackrequest.requests')
22+
23+
SlackRequest.do('xoxb-123', 'files.info', {'file': 'myFavoriteFileID'})
24+
25+
assert requests.post.call_count == 1
26+
args, kwargs = requests.post.call_args
27+
assert 'https://slack.com/api/files.info' == args[0]
28+
assert {'file': "myFavoriteFileID",
29+
'token': 'xoxb-123'} == kwargs['data']
30+
assert None == kwargs['files']
31+
2032
def test_post_attachements(mocker):
2133
requests = mocker.patch('slackclient._slackrequest.requests')
2234

0 commit comments

Comments
 (0)