Skip to content

Populate database and test

Amy Ceesay Lopez requested to merge 8-populate-database into main

Closes #8 (closed)

Changes made:

Main.py

  • Added constant SOURCE_FILEPATH - this is where quotes sourced from API are stored - made the path platform independent.
  • Added constant for the database file name and placed it at the top for easy access since the file grew in size.
  • Changed the primary key of the 'FamousQuotes' table to be a unique integer ID, as author name is not unique in our sourced quotes.
  • Added code to populate the database with all authors and respective quotes found in data.json

testDbPopulated.py

  • Tested changes after executing Main.py by inspecting FamousQuotes.db and writing to DbPopulatedResults.txt for easy review.

testDbPopulatedResults.txt

  • Database has been populated with 504 records

Merge request reports