Skip to content

Commit c8d19e8

Browse files
Removed redundant assertions
1 parent 7dc0a4a commit c8d19e8

File tree

1 file changed

+2
-39
lines changed

1 file changed

+2
-39
lines changed

model_armor/snippets/snippets_test.py

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -505,11 +505,6 @@ def test_create_model_armor_template_with_basic_sdp(
505505
created_template = create_model_armor_template_with_basic_sdp(
506506
project_id, location_id, template_id
507507
)
508-
expected_name_format = (
509-
f"projects/{project_id}/locations/{location_id}/templates/{template_id}"
510-
)
511-
512-
assert created_template.name == expected_name_format
513508

514509
filter_enforcement = (
515510
created_template.filter_config.sdp_settings.basic_config.filter_enforcement
@@ -541,12 +536,6 @@ def test_create_model_armor_template_with_advanced_sdp(
541536
sdp_deidentify_template_id,
542537
)
543538

544-
expected_name_format = (
545-
f"projects/{project_id}/locations/{location_id}/templates/{template_id}"
546-
)
547-
548-
assert created_template.name == expected_name_format
549-
550539
advanced_config = (
551540
created_template.filter_config.sdp_settings.advanced_config
552541
)
@@ -567,11 +556,7 @@ def test_create_model_armor_template_with_metadata(
567556
location_id,
568557
template_id,
569558
)
570-
expected_name_format = (
571-
f"projects/{project_id}/locations/{location_id}/templates/{template_id}"
572-
)
573559

574-
assert created_template.name == expected_name_format
575560
assert created_template.template_metadata.ignore_partial_invocation_failures
576561
assert created_template.template_metadata.log_sanitize_operations
577562

@@ -584,15 +569,9 @@ def test_create_model_armor_template_with_labels(
584569
that matches the expected format.
585570
"""
586571
expected_labels = {"name": "wrench", "count": "3"}
587-
588-
created_template = create_model_armor_template_with_labels(
572+
create_model_armor_template_with_labels(
589573
project_id, location_id, template_id, labels=expected_labels
590574
)
591-
expected_name_format = (
592-
f"projects/{project_id}/locations/{location_id}/templates/{template_id}"
593-
)
594-
595-
assert created_template.name == expected_name_format
596575

597576
template_with_labels = get_model_armor_template(
598577
project_id, location_id, template_id
@@ -641,11 +620,6 @@ def test_update_model_armor_template_metadata(
641620
project_id, location_id, template_id
642621
)
643622

644-
expected_name_format = (
645-
f"projects/{project_id}/locations/{location_id}/templates/{template_id}"
646-
)
647-
648-
assert updated_template.name == expected_name_format
649623
assert updated_template.template_metadata.ignore_partial_invocation_failures
650624
assert updated_template.template_metadata.log_sanitize_operations
651625

@@ -663,14 +637,9 @@ def test_update_model_armor_template_labels(
663637

664638
template_id, _ = all_filter_template
665639

666-
updated_template = update_model_armor_template_labels(
640+
update_model_armor_template_labels(
667641
project_id, location_id, template_id, expected_labels
668642
)
669-
expected_name_format = (
670-
f"projects/{project_id}/locations/{location_id}/templates/{template_id}"
671-
)
672-
673-
assert updated_template.name == expected_name_format
674643

675644
template_with_lables = get_model_armor_template(
676645
project_id, location_id, template_id
@@ -695,12 +664,6 @@ def test_update_model_armor_template_with_mask_configuration(
695664
project_id, location_id, template_id
696665
)
697666

698-
expected_name_format = (
699-
f"projects/{project_id}/locations/{location_id}/templates/{template_id}"
700-
)
701-
702-
assert updated_template.name == expected_name_format
703-
704667
filter_enforcement = (
705668
updated_template.filter_config.sdp_settings.basic_config.filter_enforcement
706669
)

0 commit comments

Comments
 (0)