-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Now allowing direct assignment for many-to-many or using through
- Loading branch information
Showing
4 changed files
with
147 additions
and
17 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
nautobot_design_builder/contrib/tests/testdata/next_prefix_for_location.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
extensions: | ||
- "nautobot_design_builder.contrib.ext.NextPrefixExtension" | ||
- "nautobot_design_builder.contrib.ext.ChildPrefixExtension" | ||
designs: | ||
- location_types: | ||
- name: "Region" | ||
content_types: | ||
- "!get:app_label": "ipam" | ||
"!get:model": "prefix" | ||
locations: | ||
- "name": "Region" | ||
"location_type__name": "Region" | ||
"status__name": "Active" | ||
prefixes: | ||
- prefix: "10.0.0.0/23" | ||
type: "container" | ||
status__name: "Active" | ||
locations: | ||
- location: | ||
"!get:name": "Region" | ||
- "!next_prefix": | ||
locations__name: "Region" | ||
type: "container" | ||
length: 26 | ||
status__name: "Active" | ||
description: "Region Parent Prefix" | ||
type: "container" | ||
- "!next_prefix": | ||
locations__name: "Region" | ||
type: "container" | ||
length: 26 | ||
status__name: "Active" | ||
description: "Region Parent Prefix" | ||
type: "container" | ||
checks: | ||
- model_exists: | ||
model: "nautobot.ipam.models.Prefix" | ||
query: {prefix: "10.0.0.0/26"} | ||
- model_exists: | ||
model: "nautobot.ipam.models.Prefix" | ||
query: {prefix: "10.0.0.64/26"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
nautobot_design_builder/tests/testdata/prefixes_for_location.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
depends_on: "base_test.yaml" | ||
designs: | ||
- locations: | ||
- "!update:name": "Site" | ||
prefixes: | ||
- prefix: | ||
prefix: "10.1.0.0/16" | ||
status__name: "Active" | ||
- prefixes: | ||
- prefix: "10.0.0.0/23" | ||
type: "container" | ||
status__name: "Active" | ||
locations: | ||
- location: | ||
"!get:name": "Site" | ||
checks: | ||
- model_exists: | ||
model: "nautobot.ipam.models.Prefix" | ||
query: {location__name: "Site", prefix: "10.0.0.0/23"} | ||
- model_exists: | ||
model: "nautobot.ipam.models.Prefix" | ||
query: {location__name: "Site", prefix: "10.1.0.0/16"} |
21 changes: 21 additions & 0 deletions
21
nautobot_design_builder/tests/testdata/prefixes_for_location_without_through.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
depends_on: "base_test.yaml" | ||
designs: | ||
- locations: | ||
- "!update:name": "Site" | ||
prefixes: | ||
- prefix: "10.1.0.0/16" | ||
status__name: "Active" | ||
- prefixes: | ||
- prefix: "10.0.0.0/23" | ||
type: "container" | ||
status__name: "Active" | ||
locations: | ||
- "!get:name": "Site" | ||
checks: | ||
- model_exists: | ||
model: "nautobot.ipam.models.Prefix" | ||
query: {location__name: "Site", prefix: "10.0.0.0/23"} | ||
- model_exists: | ||
model: "nautobot.ipam.models.Prefix" | ||
query: {location__name: "Site", prefix: "10.1.0.0/16"} |