def test_search(): result = yt.search(key=youtube_key, part='snippet', q='test bitcoin') assert {'queryTime', 'param_part'}.issubset(result.columns)
def test_empty_list_raises_error(): with pytest.raises(ValueError): yt.search(key=youtube_key, part='snippet', q='testing bitcoin', regionCode=[])
def test_errors_returned_as_df(): result = yt.search(key='wrong key', part='snippet', q='testing bitcoin')
def test_with_zero_results_required(): result = yt.search(key=youtube_key, part='snippet', q='testing bitcoin', maxResults=0)