jhudsl / ottrpal

Tools for converting OTTR courses into Leanpub or Coursera courses :otter:
https://jhudatascience.org/ottrpal/
GNU General Public License v3.0
3 stars 1 forks source link

Every function needs a testthat test #149

Open cansavvy opened 3 days ago

cansavvy commented 3 days ago

Every function should have a test. I'm starting to work on this but its gonna be a big job.

test? function name function description
n auth_from_secret() Use secrets to authorize R package to access Google Slides API
n authorize() Authorize R package to access the Google Slides API
y bad_quiz_path() Path to bad example quiz
y check_all_questions() Check all quiz questions
y check_question() Check Quiz Question Set Up
y check_quiz() Check Quiz
n check_quiz_attributes() Check Quiz Attributes
n check_quiz_question_attributes() Check a question's attributes
n check_quizzes() Check all quizzes in a directory
n convert_coursera_quizzes() Convert Leanpub md quiz to Coursera yaml quiz
n convert_quiz() Convert Leanpub md quiz to Coursera yaml quiz
n course_path() Find main course git directory
n course_to_book_txt() Create Book.txt file from files existing in quiz directory
n render_without_toc() Create TOC-less course website for use in Coursera or Leanpub
n download_ottr_template() Download files from main OTTR_Template to test
n encrypt_creds_path() Get file path to an encrypted credentials RDS
n encrypt_creds_user_path() Get file path to an default credentials RDS
n extract_meta() Extract meta fields from a tag
n extract_object_id() Extract Object IDs using Google Slides API
n get_chapters() Make Leanpub file that has embed webpage of a chapter
n get_gs_pptx() Download Google Slides pptx file
n get_object_id_notes() Retrieve Speaker Notes and their corresponding Object (Slide) IDs from a Google Slides presentation
n get_slide_id() Get Slide ID from URL
n get_yaml_spec() Load in yaml specifications from _bookdown.yml or _quarto.yml
n good_quiz_path() Path to good example quiz
n gs_id_from_slide() get_image_link_from_slide() get_image_from_slide() Google Slides Helper Functions
n gs_png_url() get_slide_page() gs_png_download() include_slide() Get Google Slide PNG URL
n key_encrypt_creds_path() Get file path to an key encryption RDS
n make_embed_markdown() Make Leanpub file that has embed webpage of a chapter
n output_destination() Declare file path to docs/ folder
n parse_q_tag() Parse apart a tag
n parse_quiz() extract_quiz() Parse Quiz and Other Checking Functions
n parse_quiz_df() Parse quiz into a data.frame
n pptx_notes() pptx_slide_text_df() pptx_slide_note_df() unzip_pptx() Get Notes from a PowerPoint (usually from Google Slides)
n qrmd_files() Get file paths to all qmds or rmds in the course website directory
n set_knitr_image_path() Set image path for knitr
n set_up_leanpub() Set up Manuscript folder for Leanpub publishing
n website_to_embed_leanpub() Convert Website Course to Leanpub
n xml_notes() Get Notes from XML
cansavvy commented 3 days ago

A lot of these have a place in https://github.com/jhudsl/ottrpal/blob/main/tests/testthat/test-misc.R ready for them. But browse the testthat files and you should be able to see where you can build a test and I've left notes and suggestions about what tests might be needed to start.