Updated a few more tests

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
This commit is contained in:
Carlo Costino
2023-10-12 10:24:49 -04:00
parent 9031d0cb97
commit d2411e6cbe
2 changed files with 22 additions and 12 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ def test_get_user_phone_number_raises_if_both_api_requests_fail(mocker):
@pytest.mark.parametrize( @pytest.mark.parametrize(
"outbound_redacted, expected_outbound_content", ("outbound_redacted", "expected_outbound_content"),
[ [
(True, "Hello hidden"), (True, "Hello hidden"),
(False, "Hello Jo"), (False, "Hello Jo"),
+21 -11
View File
@@ -62,10 +62,10 @@ stub_template_stats = [
@pytest.mark.parametrize( @pytest.mark.parametrize(
"user", "user",
( [
create_active_user_view_permissions(), create_active_user_view_permissions(),
create_active_caseworking_user(), create_active_caseworking_user(),
), ],
) )
def test_redirect_from_old_dashboard( def test_redirect_from_old_dashboard(
client_request, client_request,
@@ -226,7 +226,7 @@ def test_inbound_messages_shows_count_of_messages_when_there_are_no_messages(
@pytest.mark.parametrize( @pytest.mark.parametrize(
"index, expected_row", ("index", "expected_row"),
enumerate( enumerate(
[ [
"(202) 867-5300 message-1 1 hour ago", "(202) 867-5300 message-1 1 hour ago",
@@ -407,7 +407,7 @@ def test_download_inbox(
@freeze_time("2016-07-01 13:00") @freeze_time("2016-07-01 13:00")
@pytest.mark.parametrize( @pytest.mark.parametrize(
"message_content, expected_cell", ("message_content", "expected_cell"),
[ [
("=2+5", "2+5"), ("=2+5", "2+5"),
("==2+5", "2+5"), ("==2+5", "2+5"),
@@ -488,7 +488,7 @@ def test_should_show_recent_templates_on_dashboard(
@pytest.mark.parametrize( @pytest.mark.parametrize(
"stats", "stats",
( [
pytest.param( pytest.param(
[stub_template_stats[0]], [stub_template_stats[0]],
), ),
@@ -496,7 +496,7 @@ def test_should_show_recent_templates_on_dashboard(
[stub_template_stats[0], stub_template_stats[1]], [stub_template_stats[0], stub_template_stats[1]],
marks=pytest.mark.xfail(raises=AssertionError), marks=pytest.mark.xfail(raises=AssertionError),
), ),
), ],
) )
def test_should_not_show_recent_templates_on_dashboard_if_only_one_template_used( def test_should_not_show_recent_templates_on_dashboard_if_only_one_template_used(
client_request, client_request,
@@ -716,7 +716,12 @@ def test_should_not_show_upcoming_jobs_on_dashboard_if_service_has_no_jobs(
assert "files waiting to send " not in page.select_one("main").text assert "files waiting to send " not in page.select_one("main").text
@pytest.mark.parametrize("permissions", (["email", "sms"],)) @pytest.mark.parametrize(
"permissions",
[
("email", "sms"),
],
)
@pytest.mark.parametrize( @pytest.mark.parametrize(
"totals", "totals",
[ [
@@ -899,7 +904,7 @@ def test_usage_page_monthly_breakdown(
@pytest.mark.parametrize( @pytest.mark.parametrize(
"now, expected_number_of_months", ("now", "expected_number_of_months"),
[ [
(freeze_time("2017-03-31 11:09:00.061258"), 6), (freeze_time("2017-03-31 11:09:00.061258"), 6),
(freeze_time("2017-01-01 11:09:00.061258"), 4), (freeze_time("2017-01-01 11:09:00.061258"), 4),
@@ -1243,7 +1248,7 @@ def test_get_dashboard_totals_adds_percentages():
assert get_dashboard_totals(stats)["email"]["failed_percentage"] == "0" assert get_dashboard_totals(stats)["email"]["failed_percentage"] == "0"
@pytest.mark.parametrize("failures,expected", [(2, False), (3, False), (4, True)]) @pytest.mark.parametrize(("failures", "expected"), [(2, False), (3, False), (4, True)])
def test_get_dashboard_totals_adds_warning(failures, expected): def test_get_dashboard_totals_adds_warning(failures, expected):
stats = {"sms": {"requested": 100, "delivered": 0, "failed": failures}} stats = {"sms": {"requested": 100, "delivered": 0, "failed": failures}}
assert get_dashboard_totals(stats)["sms"]["show_warning"] == expected assert get_dashboard_totals(stats)["sms"]["show_warning"] == expected
@@ -1286,7 +1291,7 @@ def _stats(requested, delivered, failed):
@pytest.mark.parametrize( @pytest.mark.parametrize(
"dict_in, expected_failed, expected_requested", ("dict_in", "expected_failed", "expected_requested"),
[ [
({}, 0, 0), ({}, 0, 0),
( (
@@ -1497,7 +1502,12 @@ def test_breadcrumb_shows_if_service_is_suspended(
assert "Suspended" in page.select_one(".navigation-service-name").text assert "Suspended" in page.select_one(".navigation-service-name").text
@pytest.mark.parametrize("permissions", (["email", "sms"],)) @pytest.mark.parametrize(
"permissions",
[
("email", "sms"),
],
)
def test_service_dashboard_shows_usage( def test_service_dashboard_shows_usage(
client_request, client_request,
service_one, service_one,