Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
richfitz committed Oct 18, 2023
1 parent f16b601 commit 10c61a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/privateer2/server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from contextlib import contextmanager

import docker
from privateer2.keys import check
from privateer2.util import (
Expand Down
17 changes: 12 additions & 5 deletions tests/test_keys.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
from unittest.mock import MagicMock, call
import os
import platform

import pytest
import vault_dev

import docker
import privateer2.keys
from privateer2.config import read_config
from privateer2.keys import _check_connections, _keys_data, check, configure, keygen, keygen_all
from privateer2.server import transient_server
from privateer2.keys import (
_check_connections,
_keys_data,
check,
configure,
keygen,
keygen_all,
)
from privateer2.util import string_from_volume


Expand Down Expand Up @@ -158,7 +162,9 @@ def test_can_check_connections(capsys, monkeypatch, managed_docker):
_check_connections(cfg, cfg.clients[0])

out = capsys.readouterr().out
assert out == "checking connection to 'alice' (alice.example.com)...OK\n"
assert (
out == "checking connection to 'alice' (alice.example.com)...OK\n"
)
assert mock_docker.from_env.called
client = mock_docker.from_env.return_value
mount = mock_docker.types.Mount
Expand Down Expand Up @@ -213,6 +219,7 @@ def test_can_report_connection_failure(capsys, monkeypatch, managed_docker):
remove=True,
)


def test_only_test_connection_for_clients(monkeypatch, managed_docker):
mock_check = MagicMock()
monkeypatch.setattr(privateer2.keys, "_check_connections", mock_check)
Expand Down

0 comments on commit 10c61a8

Please sign in to comment.