Update tests to use issues that still exist

This commit is contained in:
Louis Elkner-Alfaro 2024-10-25 09:55:44 -07:00
parent 5aec6e7414
commit fb6f226371

View file

@ -1,36 +1,47 @@
import generate_issues import generate_issues
import re import re
def test_split_issues_into_columns():
issues_string = 'Resolved Issue #363, #362 and Issue 361'
issues = generate_issues.parse_notes_section(issues_string)
solution = {'First Issue Title': 'Little slow downs are happening - these often signal that the server memory is getting overwhelmed?', 'First Issue URL': 'https://git.agaric.com/housingworks/app-housingworks-net/issues/363', 'Second Issue Title': 'Little slow downs are happening - these often signal that the server memory is getting overwhelmed?', 'Second Issue URL': 'https://git.agaric.com/housingworks/app-housingworks-net/issues/363', 'Third Issue Title': 'the csv Importer has quit working on both the live and test sites???', 'Third Issue URL': 'https://git.agaric.com/housingworks/app-housingworks-net/issues/362'}
if (generate_issues.split_issues_into_columns(issues) == solution): def test_split_issues_into_columns():
issues_string = "Resolved Issue #679, #678 and Issue 677"
issues = generate_issues.parse_notes_section(issues_string)
solution = {
"First Issue Title": "Update 'Same as mailing address' label in step 1 of client wizard",
"First Issue URL": "https://git.agaric.com/housingworks/app-housingworks-net/issues/679",
"Second Issue Title": "People filtering the programs listing by county can see which state the county is in",
"Second Issue URL": "https://git.agaric.com/housingworks/app-housingworks-net/issues/678",
"Third Issue Title": "Fatal error on viewing Client Households",
"Third Issue URL": "https://git.agaric.com/housingworks/app-housingworks-net/issues/677",
}
if generate_issues.split_issues_into_columns(issues) == solution:
print("TEST SPLIT ISSUES INTO COLUMNS PASSED") print("TEST SPLIT ISSUES INTO COLUMNS PASSED")
else: else:
print("TEST SPLIT ISSUES INTO COLUMNS FAILED") print("TEST SPLIT ISSUES INTO COLUMNS FAILED")
def test_parse_notes_section(): def test_parse_notes_section():
if (generate_issues.parse_notes_section('Resolved Issue #4, #5 and Issue 6') == ['4', '5', '6']): if generate_issues.parse_notes_section("Resolved Issue #4, #5 and Issue 6") == ["4","5","6"]:
print("TEST PARSE NOTES SECTION PASSED") print("TEST PARSE NOTES SECTION PASSED")
else: else:
print("TEST PARSE NOTES SECTION FAILED") print("TEST PARSE NOTES SECTION FAILED")
def test_get_issue_title_and_url(): def test_get_issue_title_and_url():
solution = [ solution = [
"Little slow downs are happening - these often signal that the server memory is getting overwhelmed?", "Update 'Same as mailing address' label in step 1 of client wizard",
"https://git.agaric.com/housingworks/app-housingworks-net/issues/363" "https://git.agaric.com/housingworks/app-housingworks-net/issues/679",
] ]
if generate_issues.get_issue_title_and_url(363) == solution: if generate_issues.get_issue_title_and_url(679) == solution:
print("TEST GET ISSUE TITLE AND URL PASSED") print("TEST GET ISSUE TITLE AND URL PASSED")
else: else:
print("TEST GET ISSUE TITLE AND URL FAILED") print("TEST GET ISSUE TITLE AND URL FAILED")
def run_tests(): def run_tests():
test_parse_notes_section() test_parse_notes_section()
test_get_issue_title_and_url() test_get_issue_title_and_url()
test_split_issues_into_columns() test_split_issues_into_columns()
run_tests()
run_tests()