| 12345678910111213141516171819202122232425262728 | """Test configuration"""import osfrom rival_regions_wrapper import LocalAuthentication, ApiWrapperfrom dotenv import load_dotenvimport pytestload_dotenv()class MissingAuthenticationError(Exception):    """Error for missing authentication"""@pytest.fixture(scope="module")def api_wrapper():    """Set up wrapper before test"""    rr_username = os.environ.get('RIVAL_REGIONS_USERNAME', None)    rr_password = os.environ.get('RIVAL_REGIONS_PASSWORD', None)    rr_login_method = os.environ.get('RIVAL_REGIONS_LOGIN_METHOD', None)    if None in (rr_username, rr_password, rr_login_method):        raise MissingAuthenticationError(            'Load the following variables in your user environment: '            'RIVAL_REGIONS_USERNAME, RIVAL_REGIONS_PASSWORD, RIVAL_REGIONS_LOGIN_METHOD'        )    authentication = LocalAuthentication(rr_username, rr_password, rr_login_method)    return ApiWrapper(authentication)
 |