Skip to content

Commit

Permalink
gerrit: improve special agent parsing test
Browse files Browse the repository at this point in the history
Change-Id: I49ae54bf5a5865270e52d2a794de04f1665bd488
  • Loading branch information
logan-connolly committed Oct 9, 2024
1 parent a36a929 commit df188b8
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions tests/unit/cmk/plugins/gerrit/test_gerrit_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# conditions defined in the file COPYING, which is part of this source code package.


import argparse

import pytest

from cmk.utils.semantic_version import SemanticVersion
Expand All @@ -14,10 +16,19 @@

def test_parse_arguments() -> None:
argv = ["--user", "abc", "--password", "123", "review.gerrit.com"]
args = agent.parse_arguments(argv)

value = (args.user, args.password, args.hostname)
expected = ("abc", "123", "review.gerrit.com")
value = agent.parse_arguments(argv)
expected = argparse.Namespace(
debug=False,
verbose=0,
vcrtrace=False,
user="abc",
password_ref=None,
password="123",
proto="https",
port=443,
hostname="review.gerrit.com",
)

assert value == expected

Expand Down

0 comments on commit df188b8

Please sign in to comment.