Skip to content

Commit

Permalink
setup parser for test
Browse files Browse the repository at this point in the history
  • Loading branch information
lagrip committed Oct 3, 2024
1 parent f8526e6 commit 6cba613
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions tests/unit/agent_based/test_ovpnusers.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,15 @@
)
from cmk.base.plugins.agent_based import openvpn

# @pytest.mark.parametrize('section, result', [
# ([{
# "n_clients": 0,
# "ovpn_dco_available": False,
# "ovpn_dco_ver": "Kernel module not loaded"
# }], None),
# # ([[0]], 0),
# # ([[24]], 24),
# ])
# def test_parse_ovpnusers(section, result):
# assert openvpn.parse_ovpnusers(section) == result
@pytest.mark.parametrize('section, result', [

Check failure on line 32 in tests/unit/agent_based/test_ovpnusers.py

View workflow job for this annotation

GitHub Actions / flake8_py3

E302

expected 2 blank lines, found 1
([['{'], ['"n_clients": 0,'], ['"ovpn_dco_available": false,'], ['"ovpn_dco_ver": "Kernel module not loaded"'], ['}']], 0),
([['{'], ['"n_clients": 24,'], ['"ovpn_dco_available": false,'], ['"ovpn_dco_ver": "Kernel module not loaded"'], ['}']], 24),
])
def test_parse_ovpnusers(section, result):
assert openvpn.parse_ovpnusers(section) == result


@pytest.mark.parametrize('section, result', [
(None, []),
(0, [Service()]),
(24, [Service()]),
])
Expand Down

0 comments on commit 6cba613

Please sign in to comment.