Fix tests for search
This commit is contained in:
parent
e70c7a7163
commit
2458e8a360
1 changed files with 18 additions and 2 deletions
|
@ -317,7 +317,23 @@ def test_upload(mock_post, capsys):
|
||||||
@mock.patch('toot.http.get')
|
@mock.patch('toot.http.get')
|
||||||
def test_search(mock_get, capsys):
|
def test_search(mock_get, capsys):
|
||||||
mock_get.return_value = MockResponse({
|
mock_get.return_value = MockResponse({
|
||||||
'hashtags': ['foo', 'bar', 'baz'],
|
'hashtags': [
|
||||||
|
{
|
||||||
|
'history': [],
|
||||||
|
'name': 'foo',
|
||||||
|
'url': 'https://mastodon.social/tags/foo'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'history': [],
|
||||||
|
'name': 'bar',
|
||||||
|
'url': 'https://mastodon.social/tags/bar'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'history': [],
|
||||||
|
'name': 'baz',
|
||||||
|
'url': 'https://mastodon.social/tags/baz'
|
||||||
|
},
|
||||||
|
],
|
||||||
'accounts': [{
|
'accounts': [{
|
||||||
'acct': 'thequeen',
|
'acct': 'thequeen',
|
||||||
'display_name': 'Freddy Mercury'
|
'display_name': 'Freddy Mercury'
|
||||||
|
@ -330,7 +346,7 @@ def test_search(mock_get, capsys):
|
||||||
|
|
||||||
console.run_command(app, user, 'search', ['freddy'])
|
console.run_command(app, user, 'search', ['freddy'])
|
||||||
|
|
||||||
mock_get.assert_called_once_with(app, user, '/api/v1/search', {
|
mock_get.assert_called_once_with(app, user, '/api/v2/search', {
|
||||||
'q': 'freddy',
|
'q': 'freddy',
|
||||||
'resolve': False,
|
'resolve': False,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue