# Path: typtop/config.py
# SEC_DB_PATH = '/etc/typtop.d'
# 
# DISTRO = set_distro()


import pytest
import pam   # python-pam
import os
import subprocess
import time
    import pwd, grp
    import crypt, shutil
from typtop.config import SEC_DB_PATH, DISTRO
    DISTRO=='windows',
    reason="pam does not work here! Need find new method "
)
def test_login_correctpw():
    assert check(0)
    time.sleep(.4)
    assert check(1)
    assert check(2)
    assert not check(3)


@pytest.mark.skipif(
    DISTRO=='windows',
    reason="pam does not work here! Need find new method "
)
def test_train_pass():
    assert not check(4)
    for _ in range(2):
        check(3)
        if check(4):
            break
        check(0)
    assert not check(3)
    assert check(4)
    assert check(0)


def drop_privileges(uid_name='nobody', gid_name='nogroup'):
    if os.getuid() != 0:
        # We're not root so, like, whatever dude

# Path: typtop/config.py
# SEC_DB_PATH = '/etc/typtop.d'
# 
# DISTRO = set_distro()


# Path: tests/test_pam.py
import pytest
import pam   # python-pam
import os
import subprocess
import time
    import pwd, grp
    import crypt, shutil
from typtop.config import SEC_DB_PATH, DISTRO

    DISTRO=='windows',
    reason="pam does not work here! Need find new method "
)
def test_login_correctpw():
    assert check(0)
    time.sleep(.4)
    assert check(1)
    assert check(2)
    assert not check(3)


@pytest.mark.skipif(
    DISTRO=='windows',
    reason="pam does not work here! Need find new method "
)
def test_train_pass():
    assert not check(4)
    for _ in range(2):
        check(3)
        if check(4):
            break
        check(0)
    assert not check(3)
    assert check(4)
    assert check(0)


def drop_privileges(uid_name='nobody', gid_name='nogroup'):
    if os.getuid() != 0:
        # We're not root so, like, whatever dude

        return