Skip to content

Commit

Permalink
Fix logical merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
DasSkelett committed Dec 17, 2023
1 parent 4e9a53a commit 57de0ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 1 addition & 3 deletions wgkex/worker/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,6 @@ def wg_interface_name(domain: str) -> Optional[str]:
continue
break
if not cleaned_domain:
raise ValueError(
f"Could not find a match for {domain_prefixes} on {domain}"
)
raise ValueError(f"Could not find a match for {domain_prefixes} on {domain}")
# this will not work, if we have non-unique prefix stripped domains
return f"wg-{cleaned_domain}"
7 changes: 3 additions & 4 deletions wgkex/worker/mqtt_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@


def _get_config_mock(domains=None, mqtt=None):
test_prefix = "_ffmuc_"
test_prefixes = ["_ffmuc_", "_TEST_PREFIX2_"]
config_mock = mock.MagicMock()
config_mock.domains = (
domains if domains is not None else [f"{test_prefix}domain.one"]
domains if domains is not None else [f"{test_prefixes[0]}domain.one"]
)
config_mock.domain_prefix = test_prefix
config_mock.domain_prefixes = test_prefixes
if mqtt:
config_mock.mqtt = mqtt
return config_mock
Expand Down Expand Up @@ -54,7 +54,6 @@ def test_connect_fails_mqtt_error(self, config_mock, mqtt_mock):
with self.assertRaises(ValueError):
mqtt.connect(threading.Event())


@mock.patch.object(mqtt, "get_config")
@mock.patch.object(mqtt, "get_connected_peers_count")
def test_publish_metrics_loop_success(self, conn_peers_mock, config_mock):
Expand Down

0 comments on commit 57de0ca

Please sign in to comment.