aboutsummaryrefslogblamecommitdiff
blob: a8ab33a26e66e656df0edb768c611d04c590cac3 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
             
          

                  
                         


                                              

                                           




                                                                   















                                                                                                                        
import pytest
import vcr

@pytest.mark.vcr()
def test_search(api):    
    results = api.search_v2('mastodonpy_test')
    assert isinstance(results, dict)
    
    results = api.search('mastodonpy_test')
    assert isinstance(results, dict)

    results = api.search('mastodonpy_test', result_type="statuses")
    assert isinstance(results, dict)
    assert len(results["hashtags"]) == 0
    assert len(results["accounts"]) == 0

def test_search_pre_2_9_2(api):
    with vcr.use_cassette('test_search.yaml', cassette_library_dir='tests/cassettes_pre_2_9_2', record_mode='none'):    
        results = api.search_v1('mastodonpy_test')
        assert isinstance(results, dict)
        
        results = api.search_v2('mastodonpy_test')
        assert isinstance(results, dict)
        
        results = api.search('mastodonpy_test')
        assert isinstance(results, dict)

        results = api.search('mastodonpy_test', result_type="statuses")
        assert isinstance(results, dict)
        assert len(results["hashtags"]) == 0
        assert len(results["accounts"]) == 0
Powered by cgit v1.2.3 (git 2.41.0)