Difference between revisions of "User:Alvonruff/ISFDB Tests"
Jump to navigation
Jump to search
Line 419: | Line 419: | ||
|- | |- | ||
|} | |} | ||
+ | |||
+ | ===Award-Related Methods=== | ||
+ | These are mostly methods that perform a select on the awards table. | ||
+ | |||
+ | ==Class Tests== | ||
+ | ===authorClass Methods=== | ||
+ | {| border="1" cellpadding="2" style="border-collapse:collapse; text-align:left; width:30%;" | ||
+ | ! SQL Method | ||
+ | ! Status | ||
+ | |- | ||
+ | | load(self, id) | ||
+ | | | ||
+ | |- | ||
+ | | obj2xml(self) | ||
+ | | | ||
+ | |- | ||
+ | | xml2obj(self, xml) | ||
+ | | | ||
+ | |- | ||
+ | | cgi2obj(self) | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | ===awardcatClass Methods=== | ||
+ | {| border="1" cellpadding="2" style="border-collapse:collapse; text-align:left; width:30%;" | ||
+ | ! SQL Method | ||
+ | ! Status | ||
+ | |- | ||
+ | | load(self) | ||
+ | | | ||
+ | |- | ||
+ | | cgi2obj(self) | ||
+ | | | ||
+ | |- | ||
+ | | PrintAwardCatYear(self, year) | ||
+ | | | ||
+ | |- | ||
+ | | PrintAwardCatTable(self, years) | ||
+ | | | ||
+ | |- | ||
+ | | PrintAwardCatSummary(self, win_nom) | ||
+ | | | ||
+ | |- | ||
+ | | PrintAwardCatPageHeader(self) | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===awardClass Methods=== | ||
+ | ===awardtypeClass Methods=== | ||
+ | ===pubClass Methods=== | ||
+ | ===publisherClass Methods=== | ||
+ | ===pubseriesClass Methods=== | ||
+ | ===seriesClass Methods=== | ||
+ | ===templateClass Methods=== | ||
+ | ===titleClass Methods=== | ||
+ | ===verificationsourceClass Methods=== |
Revision as of 08:14, 21 May 2023
These are formal tests using the unittest module. The tests are mostly concerned with:
- Testing return types (int, string, float, etc).
- Testing input arguments.
- Testing for select statements that return nothing.
Although non-destructive, these tests should probably not be run against the production server. The goal is to be able to run the tests on both Python2 and Python3, and generate exactly the same results.
SQLparsing Tests
Author-Related Methods
These are mostly methods that perform a select on the authors table.
SQL Method | Status |
---|---|
SQLAuthorsBorn(date) | DONE |
SQLAuthorsDied(date) | DONE |
SQLFindAuthors(target, mode = 'contains') | DONE |
SQLFindReviewParent(title, author, referral_lang) | Later (only used by mod scripts) |
SQLgetActualFromPseudo(au_id) | DONE |
SQLGetAllAuthorsForPublisher(publisher_id, sort_by) | DONE |
SQLgetAuthorData(author) | DONE |
SQLGetAuthorDirectory() | DONE |
SQLgetBriefActualFromPseudo(au_id) | DONE |
SQLgetBriefPseudoFromActual(au_id) | DONE |
SQLGetCoverAuthorsForPubs(pub_list) | DONE |
SQLInterviewAuthors(title_id) | DONE |
SQLInterviewBriefAuthorRecords(title_id) | DONE |
SQLIntervieweeAuthors(title_id, author_id = 0) | DONE |
SQLloadAuthorData(author_id) | DONE |
SQLLoadTransAuthorNamesList(author_ids) | DONE |
SQLMultipleAuthors(name) | DONE |
SQLPubAuthors(pub_id) | DONE |
SQLPubBriefAuthorRecords(pub_id) | DONE |
SQLPubListBriefAuthorRecords(pub_list) | DONE |
SQLReviewAuthors(title_id) | DONE |
SQLReviewBriefAuthorRecords(title_id) | |
SQLReviewedAuthors(title_id) | |
SQLTitleAuthors(title_id) | |
SQLTitleBriefAuthorRecords(title_id) | DONE |
SQLTitleListBriefAuthorRecords(title_list, author_id = 0) | |
SQLtransLegalNames(author_ids) |
Title-Related Methods
These are mostly methods that perform a select on the titles table.
SQL Method | Status |
---|---|
SQLaddTagToTitle(tag, title_id, user_id) | |
SQLCountPubsForTitle(title_id) | |
SQLDeletedTitle(title_id) | |
SQLFindExactTitles(target) | |
SQLFindFictionTitles(target) | |
SQLfindReviewedTitle(review_id) | |
SQLFindSeriesTitles(target) | |
SQLFindTitles(target) | |
SQLgetAllTitleTags(title_id, parent_id, user_id) | |
SQLGetCoverPubsByTitle(titlerec) | |
SQLGetLangIdByTitle(title_id) | |
SQLGetPubsByTitle(titlerec) | |
SQLGetPubsByTitleNoParent(titlerec) | |
SQLGetPubsByTitleNoTranslations(titlerec) | |
SQLGetPubsForChildTitles(titlerec) | |
SQLgetPubTitle(pubId) | |
SQLgetTagsByTitleForTitleList(title_ids, user_id) | |
SQLgetTitle(titleId) | |
SQLgetTitleByTagId(tagmap_id) | |
SQLgetTitleListTags(title_list, user_id) | |
SQLgetTitleReferral(pub_id, pub_ctype, include_editors=0) | |
SQLgetTitleReferralList(pubs, include_editors=0) | |
SQLgetTitlesForAuthorAndTag(tag_id, author_id) | |
SQLgetTitlesForTag(tag_id, start) | |
SQLgetTitlesForTagForUser(tag_id, user_id, start) | |
SQLgetTitleTags(title_id) | |
SQLgetTitleTagsByUser(title_id) | |
SQLgetTitleVariants(title_id) | |
SQLloadAllAuthorTitles(aurec, page_type, languages_all, languages) | |
SQLloadAllTitleReviews(title_id) | |
SQLloadAnyTitles(aurec) | |
SQLLoadReviewsForTitle(title_id) | |
SQLLoadSeriesListTitles(series_list) | |
SQLloadTitle(titlerec) | |
SQLloadTitleFromAward(award_id) | |
SQLloadTitleList(title_ids) | |
SQLloadTitlesXBS(series) | |
SQLloadTitlesXBT(recno) | |
SQLloadTitleWebpages(title_id) | |
SQLloadTransPubTitles(pub_id) | |
SQLLoadTransPubTitlesList(pub_ids) | |
SQLloadTransTitles(title_id) | |
SQLLoadTransTitlesList(title_ids) | |
SQLloadVTsForAuthor(author_id) | |
SQLloadVTsForTitleList(title_list) | |
SQLTitleAuthors(title_id) | |
SQLTitleAwards(title_id) | |
SQLTitleBriefAuthorRecords(title_id) | |
SQLTitleListBriefAuthorRecords(title_list, author_id = 0) | |
SQLTitlesWithPubs(title_list) | |
SQLupdateTitleViews(title_id) |
Publication-Related Methods
These are mostly methods that perform a select on the pubs table.
SQL Method | Status |
---|---|
SQLGetFrontPagePubs(front_page) | |
SQLGetNextMonthPubs(additional_pubs = 0) | |
SQLGetPubByTag(tag) | |
SQLGetPubById(id) | |
SQLGetCoverAuthorsForPubs(pub_list) | |
SQLGetCoverPubsByTitle(titlerec) | |
SQLGetPubsByTitle(titlerec) | |
SQLGetPubsByTitleNoParent(titlerec) | |
SQLGetPubsByTitleNoTranslations(titlerec) | |
SQLGetPubsForChildTitles(titlerec) | |
SQLGetPubsByPublisherYear(publisher_id, year) | |
SQLGetPubsByAuthor(aurec) | |
SQLGetPubContentByAuthor(aurec) | |
SQLGetPublisher(pubrec) | |
SQLGetPublisherList(publisher_list) | |
SQLGetPublisherDirectory() | |
SQLGetPubSeries(pub_series_id) | |
SQLGetPubSeriesByName(pub_series_name) | |
SQLGetPubSeriesList(pub_series_list) | |
SQLLoadPubSeries(pub_series_ids) | |
SQLGetPubSeriesPubs(pub_series_id, display_order) | |
SQLCountPubsNotInPubSeries(publisher_id) | |
SQLGetPubsNotInSeries(publisher_id) | |
SQLFindPublisher(target, mode = 'contains') | |
SQLGetPublisherYears(publisher_id) | |
SQLFindPubSeries(target, mode = 'contains') | |
SQLFindPubsByIsbn(targets, excluded_pub_id = 0) | |
SQLFindPubsByCatalogId(value) | |
SQLFindPubSeriesForPublisher(publisher_id) | |
SQLgetPublisherName(id) | |
SQLPubBriefAuthorRecords(pub_id) | |
SQLPubListBriefAuthorRecords(pub_list) | |
SQLloadPublisherWebpages(publisher_id) | |
SQLloadTransPubSeriesNames(pub_series_id) | |
SQLLoadTransPubSeriesList(pub_series_ids) | |
SQLloadTransPublisherNames(publisher_id) | |
SQLLoadTransPublisherList(publisher_ids) | |
SQLloadTransPubTitles(pub_id) | |
SQLLoadTransPubTitlesList(pub_ids) | |
SQLloadPubSeriesWebpages(publisher_id) | |
SQLloadPubWebpages(pub_id) | |
SQLgetPubTitle(pubId) | |
SQLTitlesWithPubs(title_list) | |
SQLGetPubContentList(pub_id) | |
SQLPubArtists(pubid) | |
SQLPubCovers(pubid) | |
SQLFindPubByExternalID(id_type, id_value) | |
SQLCountPubsForTitle(title_id) | |
SQLDeletedPub(pubid) | |
SQLGetPubsForAuthorPublisher(publisher_id, author_id) |
Award-Related Methods
These are mostly methods that perform a select on the awards table.
Class Tests
authorClass Methods
SQL Method | Status |
---|---|
load(self, id) | |
obj2xml(self) | |
xml2obj(self, xml) | |
cgi2obj(self) |
awardcatClass Methods
SQL Method | Status |
---|---|
load(self) | |
cgi2obj(self) | |
PrintAwardCatYear(self, year) | |
PrintAwardCatTable(self, years) | |
PrintAwardCatSummary(self, win_nom) | |
PrintAwardCatPageHeader(self) |