This commit is contained in:
parent
880a210b9b
commit
3728594b4e
6 changed files with 36 additions and 4 deletions
|
@ -11,4 +11,4 @@ jobs:
|
|||
check-code:
|
||||
uses: actions/workflows/.gitea/workflows/check_python_hatch.yml@master
|
||||
with:
|
||||
run-tests: false
|
||||
run-tests: true
|
||||
|
|
3
.github/workflows/check_code.yml
vendored
3
.github/workflows/check_code.yml
vendored
|
@ -26,3 +26,6 @@ jobs:
|
|||
|
||||
- name: test typing
|
||||
run: hatch run lint:typing
|
||||
|
||||
- name: test typing
|
||||
run: hatch run default:test
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
octodns==1.4.0
|
||||
octodns-spf==0.0.2
|
||||
octodns-netbox-dns==0.3.3
|
3
justfile
3
justfile
|
@ -57,6 +57,9 @@ check:
|
|||
build:
|
||||
hatch build --clean
|
||||
|
||||
test:
|
||||
hatch run default:test
|
||||
|
||||
up:
|
||||
docker compose -f dev/compose.yml up
|
||||
|
||||
|
|
|
@ -50,6 +50,8 @@ python = "3.11"
|
|||
dependencies = [
|
||||
"pytest==7.4.4",
|
||||
"coverage==7.4.2",
|
||||
"octodns==1.4.0",
|
||||
"octodns-spf==0.0.2",
|
||||
]
|
||||
|
||||
[tool.hatch.envs.default.scripts]
|
||||
|
|
27
tests/test_source.py
Normal file
27
tests/test_source.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
from octodns_netbox_dns import NetBoxDNSSource
|
||||
|
||||
|
||||
DEFAULT_CONFIG = {
|
||||
"id": 1,
|
||||
"url": "https://localhost:8000",
|
||||
"token": "",
|
||||
"view": False,
|
||||
"replace_duplicates": False,
|
||||
"make_absolute": True,
|
||||
}
|
||||
|
||||
|
||||
def test_absolute1():
|
||||
nbdns = NetBoxDNSSource(**DEFAULT_CONFIG)
|
||||
rcd = "example.com"
|
||||
absolute = nbdns._make_absolute(rcd)
|
||||
|
||||
assert absolute == "example.com."
|
||||
|
||||
|
||||
def test_absolute2():
|
||||
nbdns = NetBoxDNSSource(**DEFAULT_CONFIG)
|
||||
rcd = "example.com."
|
||||
absolute = nbdns._make_absolute(rcd)
|
||||
|
||||
assert absolute == "example.com."
|
Loading…
Reference in a new issue