youtube-data-api icon indicating copy to clipboard operation
youtube-data-api copied to clipboard

Tests!

Open mabrownnyu opened this issue 5 years ago • 0 comments

TESTS

Tests for get_captions

Located in test_captions_methods.py

Function Tested

def get_captions(self, video_id, lang_code='en', parser=P.parse_caption_track, **kwargs)

TO DO

  • [ ] parser
  • [ ] LIST OF VALID VIDEO IDS DOES NOT WORK AND I HAVE NO IDEA WHY
  • [x] video_id
  • [x] lang_code

Tests for get_channel_id_from_user

Located in test_channel_methods.py

Function Tested

def get_channel_id_from_user(self, username, **kwargs)

TO DO

  • [x] get_channel_id_from_user

Tests for get_channel_metadata_gen

Located in test_channel_methods.py

Function Tested

def get_channel_metadata_gen(self, channel_id, parser=P.parse_channel_metadata, part=["id", "snippet", "contentDetails", "statistics", "topicDetails", "brandingSettings"], **kwargs)

TO DO

  • [ ] channel_id for list
  • [ ] channel_id for individual string
  • [ ] parser
  • [ ] part

Tests for get_channel_metadata

Located in test_channel_methods.py

Function Tested

def get_channel_metadata(self, channel_id, parser=P.parse_channel_metadata, part=["id", "snippet", "contentDetails", "statistics", "topicDetails", "brandingSettings"], **kwargs)

TO DO

  • [ ] channel_id for list
  • [ ] channel_id for individual string
  • [ ] parser
  • [ ] part

Tests for get_subscriptions

Located in test_channel_methods.py

Function Tested

def get_subscriptions(self, channel_id, next_page_token=False, parser=P.parse_subscription_descriptive, part=['id', 'snippet'], **kwargs)

TO DO

  • [ ] channel_id for list
  • [ ] channel_id for individual string
  • [ ] parser
  • [ ] part
  • [ ] next page token

Tests for get_featured_channels

Located in test_channel_methods.py

Function Tested

def get_featured_channels(self, channel_id, parser=P.parse_featured_channels, **kwargs)

TO DO

  • [ ] channel_id for list
  • [ ] channel_id for individual string
  • [ ] parser
  • [ ] part
  • [ ] next page token

Tests for get_featured_channels_gen

Located in test_channel_methods.py

Function Tested

def get_featured_channels_gen(self, channel_id, parser=P.parse_featured_channels, part=["id", "brandingSettings"], **kwargs)

TO DO

  • [ ] channel_id for list
  • [ ] channel_id for individual string
  • [ ] parser
  • [ ] part
  • [ ] next page token

Tests for __init__

Located in test_initialization.py

Function Tested

def __init__(self, key, api_version='3')

TO DO

  • [x] test valid key
  • [x] test invalid key

Tests for verify_key

Located in test_initialization.py

Function Tested

def verify_key(self)

TO DO

  • [x] test valid key
  • [x] test invalid key

Tests for get_playlists

Located in test_playlist_methods.py

Function Tested

def get_playlists(self, channel_id, next_page_token=False, parser=P.parse_playlist_metadata, part=['id','snippet','contentDetails'], **kwargs)

TO DO

  • [ ] channel_id
  • [ ] next_page_token
  • [ ] parser
  • [ ] part

Tests for get_video_from_playlist_id

Located in test_playlist_methods.py

Function Tested

def get_videos_from_playlist_id(self, playlist_id, next_page_token=None, published_after=datetime.datetime(1990,1,1), parser=P.parse_video_url, part=['snippet'], **kwargs)

TO DO

  • [ ] playlist_id
  • [ ] next_page_token
  • [ ] parser
  • [ ] part
  • [ ] published_after

Tests for search

Located in test_search_args.py

Function Tested

def search(self, q=None, channel_id=None, max_results=5, order_by="relevance", next_page_token=None, published_after=datetime.datetime(2000,1,1), published_before=datetime.datetime(3000,1,1), location=None, location_radius='1km', region_code=None, safe_search=None, relevance_language=None, event_type=None, topic_id=None, video_duration=None, search_type="video", parser=P.parse_rec_video_metadata, part=['snippet'], **kwargs)

TO DO

  • [x] q
  • [x] channel_id
  • [x] max_results
  • [x] published_after
  • [x] published_before
  • [x] topic_id
  • [ ] order_by
  • [ ] next_page_token
  • [ ] location
  • [ ] location_radius
  • [ ] region_code
  • [ ] safe_search
  • [ ] relevance_language
  • [ ] event_type
  • [ ] video_duration
  • [ ] search_type
  • [ ] parser
  • [ ] part

Tests for get_video_metadata_gen

Located in test_video_methods.py

Function tested

def get_video_metadata_gen(self, video_id, parser=P.parse_video_metadata, part=['statistics','snippet'], **kwargs)

TO DO

  • [x] video_id
  • [ ] parser
  • [ ] part

Tests for get_video_metadata

Located in test_video_methods.py

Function tested

def get_video_metadata(self, video_id, parser=P.parse_video_metadata, part=['statistics','snippet'], **kwargs)

TO DO

  • [x] video_id
  • [ ] parser
  • [ ] part

Tests for get_video_comments

Located in test_video_methods.py

Function tested

def get_video_comments(self, video_id, get_replies=True, max_results=None, next_page_token=False, parser=P.parse_comment_metadata, part = ['snippet'], **kwargs)

TO DO

  • [ ] video_id
  • [ ] get_replies
  • [ ] max_results
  • [ ] next_page_token
  • [ ] parser
  • [ ] part

Tests for get_recommended_videos

Located in test_video_methods.py

Function tested

def get_recommended_videos(self, video_id, max_results=5, parser=P.parse_rec_video_metadata, **kwargs)

TO DO

  • [ ] video_id
  • [ ] max_results
  • [ ] parser

Tests for test_videos_from_playlist.py

  • [ ] MERGE WITH THE ACTUAL TEST FILE FOR THIS SET OF PLAYLISTS in test_playlist_methods.py

Tests for Parsers

Located in test_parsers.py

Functions Tested

  • def raw_json(item)
  • def raw_json_with_datetime(item)
  • def parse_video_metadata(item)
  • def parse_video_url(item)
  • def parse_channel_metadata(item)
  • def parse_subscription_descriptive(item)
  • def parse_featured_channels(item)
  • def parse_playlist_metadata(item)
  • def parse_comment_metadata(item)
  • def parse_rec_video_metadata(item)
  • def parse_caption_track(item)

TO DO

  • [x] raw_json
  • [x] parse_video_metadata
  • [x] parse_video_url
  • [x] parse_channel_metadata
  • [x] parse_featured_channels
  • [x] parse_playlist_metadata
  • [x] parse_comment_metadata
  • [x] parse_rec_video_metadata
  • [ ] def raw_json_with_datetime(item)
  • [ ] def parse_caption_track(item)
  • [ ] def parse_subscription_descriptive(item)

Tests for Utils

Located in test_utils.py

Functions Tested

  • def _chunker(l, chunksize)
  • def _load_response(response)
  • def _text_from_html(html_body)
  • def parse_yt_datetime(date_str)
  • def strip_video_id_from_url(url)
  • def get_upload_playlist_id(channel_id)
  • def get_liked_playlist_id(channel_id)
  • def is_user(channel_url)
  • def strip_youtube_id(channel_url)
  • def get_channel_id_from_custom_url(url)
  • def get_url_from_video_id(video_id)

TO DO

  • [x] get_upload_playlist_id
  • [x] get_liked_playlist_id
  • [x] parse_yt_datetime
  • [x] strip_video_id_from_url
  • [x] is_user
  • [x] get_url_from_video_id
  • [ ] _chunker
  • [ ] _load_response
  • [ ] _text_from_html
  • [ ] strip_youtube_id
  • [ ] get_channel_id_from_custom_url

mabrownnyu avatar Feb 28 '19 03:02 mabrownnyu