-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #311 from itdependsnetworks/stable-1.1-cp
Prep stable1.1 with cherry-picked commits
- Loading branch information
Showing
4 changed files
with
57 additions
and
3 deletions.
There are no files selected for viewing
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
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,46 @@ | ||
"""Unit tests for nautobot_golden_config views.""" | ||
|
||
from django.test import TestCase | ||
|
||
from nautobot.dcim.models import Device | ||
from nautobot_golden_config import views, models | ||
|
||
from .conftest import create_feature_rule_json, create_device_data | ||
|
||
|
||
class ConfigComplianceOverviewOverviewHelperTestCase(TestCase): | ||
"""Test ConfigComplianceOverviewOverviewHelper.""" | ||
|
||
def setUp(self): | ||
"""Set up base objects.""" | ||
create_device_data() | ||
dev01 = Device.objects.get(name="Device 1") | ||
dev02 = Device.objects.get(name="Device 2") | ||
dev03 = Device.objects.get(name="Device 3") | ||
dev04 = Device.objects.get(name="Device 4") | ||
|
||
feature_dev01 = create_feature_rule_json(dev01) | ||
feature_dev02 = create_feature_rule_json(dev02) | ||
feature_dev03 = create_feature_rule_json(dev03) | ||
|
||
updates = [ | ||
{"device": dev01, "feature": feature_dev01}, | ||
{"device": dev02, "feature": feature_dev02}, | ||
{"device": dev03, "feature": feature_dev03}, | ||
{"device": dev04, "feature": feature_dev01}, | ||
] | ||
for update in updates: | ||
models.ConfigCompliance.objects.create( | ||
device=update["device"], | ||
rule=update["feature"], | ||
actual={"foo": {"bar-1": "baz"}}, | ||
intended={"foo": {"bar-1": "baz"}}, | ||
) | ||
|
||
self.ccoh = views.ConfigComplianceOverviewOverviewHelper | ||
|
||
def test_plot_visual_no_devices(self): | ||
|
||
aggr = {"comp_percents": 0, "compliants": 0, "non_compliants": 0, "total": 0} | ||
|
||
self.assertEqual(self.ccoh.plot_visual(aggr), None) |
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "nautobot-golden-config" | ||
version = "1.1.0" | ||
version = "1.1.1" | ||
description = "A plugin for configuration on nautobot" | ||
authors = ["Network to Code, LLC", "<[email protected]>"] | ||
|
||
|