|
9 | 9 | from infrahub_sdk import Config, InfrahubClient, InfrahubClientSync |
10 | 10 | from infrahub_sdk.ctl.schema import display_schema_load_errors |
11 | 11 | from infrahub_sdk.exceptions import SchemaNotFoundError, ValidationError |
12 | | -from infrahub_sdk.schema import BranchSchema, InfrahubSchema, InfrahubSchemaSync, NodeSchemaAPI |
| 12 | +from infrahub_sdk.protocols import BuiltinIPAddress, BuiltinIPAddressSync, BuiltinTag, BuiltinTagSync |
| 13 | +from infrahub_sdk.schema import BranchSchema, InfrahubSchema, InfrahubSchemaBase, InfrahubSchemaSync, NodeSchemaAPI |
13 | 14 | from infrahub_sdk.schema.repository import ( |
14 | 15 | InfrahubCheckDefinitionConfig, |
15 | 16 | InfrahubJinja2TransformConfig, |
@@ -452,3 +453,12 @@ async def test_display_schema_load_errors_details_when_error_is_in_attribute_or_ |
452 | 453 | Node: SecurityTailscaleSSHRule | Attribute: check_period (10080) | Extra inputs are not permitted (extra_forbidden) |
453 | 454 | """ |
454 | 455 | assert output == expected_console |
| 456 | + |
| 457 | + |
| 458 | +def test_schema_base__get_schema_name__returns_correct_schema_name_for_protocols(): |
| 459 | + assert InfrahubSchemaBase._get_schema_name(schema=BuiltinTagSync) == "BuiltinTag" |
| 460 | + assert InfrahubSchemaBase._get_schema_name(schema=BuiltinTag) == "BuiltinTag" |
| 461 | + assert InfrahubSchemaBase._get_schema_name(schema="BuiltinTag") == "BuiltinTag" |
| 462 | + assert InfrahubSchemaBase._get_schema_name(schema=BuiltinIPAddressSync) == "BuiltinIPAddress" |
| 463 | + assert InfrahubSchemaBase._get_schema_name(schema=BuiltinIPAddress) == "BuiltinIPAddress" |
| 464 | + assert InfrahubSchemaBase._get_schema_name(schema="BuiltinIPAddress") == "BuiltinIPAddress" |
0 commit comments