-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* make it a frozen dataclass * rename to `Hosts`---it's a container of hosts, independently of how it gets its filled CMK-14467 Change-Id: I644e98db2ca8e212bbbbeae584998eae37aaafde
- Loading branch information
Showing
5 changed files
with
56 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (C) 2019 Checkmk GmbH - License: GNU General Public License v2 | ||
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and | ||
# conditions defined in the file COPYING, which is part of this source code package. | ||
|
||
from cmk.utils.hostaddress import HostName, Hosts | ||
|
||
|
||
def test_duplicate_hosts() -> None: | ||
hostnames = ( | ||
HostName("un"), | ||
HostName("deux"), | ||
HostName("deux"), | ||
HostName("trois"), | ||
HostName("trois"), | ||
HostName("trois"), | ||
) | ||
hosts_config = Hosts(hosts=hostnames, clusters=(), shadow_hosts=()) | ||
assert list(hosts_config.duplicates(lambda *args, **kw: True)) == ["deux", "trois"] |