skeleton tests
This commit is contained in:
@@ -26,6 +26,11 @@ try:
|
||||
except PermissionError as e:
|
||||
logging.critical(f"PERMISSIONS FAILURE: {e}")
|
||||
sanity: bool = False
|
||||
except Exception as e:
|
||||
logging.critical(e)
|
||||
sanity: bool = False
|
||||
finally:
|
||||
logging.info(f"Sanity: {sanity}")
|
||||
|
||||
app = Flask(__name__, template_folder='html')
|
||||
|
||||
@@ -511,11 +516,12 @@ def bible_reader():
|
||||
# Maybe preliminary theming support
|
||||
@app.get("/plan")
|
||||
def reading_plan():
|
||||
return send_file("html/reading_plan.html")
|
||||
# needs 2 sets of data, books and time frame.
|
||||
# should default to the entire Bible in 1 year.
|
||||
# should start today() and end today()+1year
|
||||
# Should return a calender with date and verse range.
|
||||
# Should return reading_plan template.
|
||||
return render_template("reading_plan.html")
|
||||
|
||||
@app.get("/status")
|
||||
def status():
|
||||
import resource
|
||||
|
||||
+44
-1
@@ -6,8 +6,51 @@
|
||||
from os import stat, getuid
|
||||
|
||||
def check_sanity():
|
||||
check_database_permissions()
|
||||
check_random()
|
||||
check_verse_of_the_day()
|
||||
check_find()
|
||||
check_define()
|
||||
check_search()
|
||||
check_show()
|
||||
check_seq()
|
||||
check_shortcode()
|
||||
|
||||
def check_database_permissions():
|
||||
dependancies = ['data/seq.db', "data/shortcodes.db"]
|
||||
current_uid = getuid()
|
||||
for dependancy in dependancies:
|
||||
if stat(dependancy).st_uid != current_uid:
|
||||
raise PermissionError(dependancy)
|
||||
raise PermissionError(dependancy)
|
||||
|
||||
def check_random():
|
||||
#TODO: Ensure random returns a verse
|
||||
pass
|
||||
|
||||
def check_verse_of_the_day():
|
||||
#TODO: Ensure VOTD returns a verse, the same, at least twice
|
||||
pass
|
||||
|
||||
def check_find():
|
||||
#TODO: Ensure that a varaity of queries don't cause an error (need to define a few)
|
||||
pass
|
||||
|
||||
def check_define():
|
||||
#TODO: Ensure a few words that are in the dictionary (and those that are not) and those misspelled, give correct responses
|
||||
pass
|
||||
|
||||
def check_search():
|
||||
#TODO: Ensure that blanket searches with different syntaxes resolve correctly
|
||||
pass
|
||||
|
||||
def check_show():
|
||||
#TODO: Ensure that many types of verse syntaxes correctly resolve.
|
||||
pass
|
||||
|
||||
def check_seq():
|
||||
#TODO: Begin a new sequence and check that it does not give us an error
|
||||
pass
|
||||
|
||||
def check_shortcode():
|
||||
#TODO: make a new shortcode for a search and then try to resolve it.
|
||||
pass
|
||||
Reference in New Issue
Block a user