From 6a254f76f199408591da5946ce52a0095f425967 Mon Sep 17 00:00:00 2001 From: Bruno MATEU Date: Sun, 18 Jun 2023 14:35:19 +0200 Subject: [PATCH] fix tests --- prometheuspvesd/test/data/config.yml | 2 ++ prometheuspvesd/test/fixtures/fixtures.py | 12 ++++++++++++ prometheuspvesd/test/unit/test_config.py | 2 ++ 3 files changed, 16 insertions(+) diff --git a/prometheuspvesd/test/data/config.yml b/prometheuspvesd/test/data/config.yml index 94fe5b0..29b8d6f 100644 --- a/prometheuspvesd/test/data/config.yml +++ b/prometheuspvesd/test/data/config.yml @@ -24,5 +24,7 @@ pve: server: proxmox.example.com user: root password: secure + token_name: pve_sd + token_value: 01234567-89ab-cdef-0123-456789abcdef auth_timeout: 5 verify_ssl: true diff --git a/prometheuspvesd/test/fixtures/fixtures.py b/prometheuspvesd/test/fixtures/fixtures.py index 6949dc0..260f81e 100644 --- a/prometheuspvesd/test/fixtures/fixtures.py +++ b/prometheuspvesd/test/fixtures/fixtures.py @@ -114,6 +114,18 @@ def builtins(): "file": True, "type": environs.Env().str }, + "pve.token_name": { + "default": "dummyname", + "env": "PVE_TOKEN_NAME", + "file": True, + "type": environs.Env().str + }, + "pve.token_value": { + "default": "dummyvalue", + "env": "PVE_TOKEN_VALUE", + "file": True, + "type": environs.Env().str + }, "pve.auth_timeout": { "default": 5, "env": "PVE_AUTH_TIMEOUT", diff --git a/prometheuspvesd/test/unit/test_config.py b/prometheuspvesd/test/unit/test_config.py index c8849ac..9d99f25 100644 --- a/prometheuspvesd/test/unit/test_config.py +++ b/prometheuspvesd/test/unit/test_config.py @@ -19,6 +19,8 @@ def test_yaml_config(mocker, defaults): defaults["pve"]["user"] = "root" defaults["pve"]["password"] = "secure" defaults["pve"]["server"] = "proxmox.example.com" + defaults["pve"]["token_name"] = "pve_sd" + defaults["pve"]["token_value"] = "01234567-89ab-cdef-0123-456789abcdef" assert config.config == defaults