Your IP : 216.73.217.62


Current Path : /lib/imh-wpapi/tests/
Upload File :
Current File : //lib/imh-wpapi/tests/conftest.py

"""pytest fixtures"""

import os
import pytest
import rads


@pytest.fixture
def access_hash():
    """Read /root/.accesshash or raise IOError"""
    with open('/root/.accesshash', encoding='utf-8') as hash_file:
        hash_lines = hash_file.read().splitlines()
    return ''.join(hash_lines)


@pytest.fixture
def username():
    """Get the cPanel user to run tests against"""
    user = os.environ.get('cpuser', rads.SECURE_USER)
    assert user
    return user