bac46cd
# template https://github.com/carletes/mock-ssh-server#sample-usage
bac46cd
bac46cd
from tests.base_test import PUB_FILE
bac46cd
bac46cd
from pytest import yield_fixture
bac46cd
bac46cd
import pwd
bac46cd
import os
bac46cd
import mockssh
bac46cd
bac46cd
@pytest.fixture()
bac46cd
def server():
bac46cd
    users = {
bac46cd
        pwd.getpwuid(os.geteuid()).pw_name: PUB_FILE,
bac46cd
    }
bac46cd
    with mockssh.Server(users) as s:
bac46cd
        yield s