Testing
nautobot_design_builder.testing
¶
This module provides a framework for testing designs.
BuilderChecks
¶
Collection of static methods for testing designs.
Source code in nautobot_design_builder/testing.py
check_connected(test, check, index)
staticmethod
¶
Check if two endpoints are connected with a cable.
Source code in nautobot_design_builder/testing.py
check_equal(test, check, index)
staticmethod
¶
Check that two values are equal.
Source code in nautobot_design_builder/testing.py
check_in(test, check, index)
staticmethod
¶
Check that a model does not exist.
Source code in nautobot_design_builder/testing.py
check_model_exists(test, check, index)
staticmethod
¶
check_model_not_exist(test, check, index)
staticmethod
¶
check_not_in(test, check, index)
staticmethod
¶
Check that a model does not exist.
Source code in nautobot_design_builder/testing.py
BuilderTestCase
¶
Bases: TestCase
, RunChecksMixin
This class provides a framework for running tests locally with defined YAML files.
Source code in nautobot_design_builder/testing.py
DesignTestCase
¶
Bases: TestCase
DesignTestCase aides in creating unit tests for design jobs and templates.
Source code in nautobot_design_builder/testing.py
assert_context_files_created(*filenames)
¶
Confirm that the list of filenames were created as part of the design implementation.
Source code in nautobot_design_builder/testing.py
get_mocked_job(design_class)
¶
Create an instance of design_class and properly mock request and job_result for testing.
Source code in nautobot_design_builder/testing.py
setUp()
¶
Setup a mock git repo to watch for config context creation.
Source code in nautobot_design_builder/testing.py
RunChecksMixin
¶
Mixin for running checks on a testcase.
Source code in nautobot_design_builder/testing.py
run_checks(checks)
¶
Run checks on a testcase.
Source code in nautobot_design_builder/testing.py
VerifyDesignTestCase
¶
Bases: DesignTestCase
, RunChecksMixin
VerifyDesignTestCase aides in verifying the test cases with queries.
Source code in nautobot_design_builder/testing.py
run_design_test()
¶
This is what class's that inherit from VerifyDesignTestCase
call to setup and run.
Source code in nautobot_design_builder/testing.py
attrgetter
¶
Return a callable object that fetches attr or key from its operand.
The attribute names can also contain dots
Source code in nautobot_design_builder/testing.py
__call__(obj)
¶
__init__(attr)
¶
Initialize the attrgetter object.