plugin.video.viervijfzes/tests/__init__.py

34 lines
954 B
Python
Raw Normal View History

2020-03-19 16:45:31 +01:00
# -*- coding: utf-8 -*-
""" Tests """
2020-03-20 13:53:21 +01:00
from __future__ import absolute_import, division, unicode_literals
2020-03-19 16:45:31 +01:00
import logging
2020-07-09 10:16:45 +02:00
import os
import sys
2020-03-19 16:45:31 +01:00
2020-07-09 10:16:45 +02:00
import xbmcaddon
try: # Python 3
from http.client import HTTPConnection
except ImportError: # Python 2
from httplib import HTTPConnection
logging.basicConfig(level=logging.DEBUG)
# Add logging to urllib
HTTPConnection.debuglevel = 1
2020-07-09 10:16:45 +02:00
# Make UTF-8 the default encoding in Python 2
if sys.version_info[0] == 2:
reload(sys) # pylint: disable=undefined-variable # noqa: F821
2020-07-09 10:16:45 +02:00
sys.setdefaultencoding("utf-8") # pylint: disable=no-member
# Set credentials based on environment data
# Use the .env file with Pipenv to make this work nicely during development
ADDON = xbmcaddon.Addon()
if os.environ.get('ADDON_USERNAME'):
2020-07-09 10:16:45 +02:00
ADDON.setSetting('username', os.environ.get('ADDON_USERNAME'))
if os.environ.get('ADDON_PASSWORD'):
2020-07-09 10:16:45 +02:00
ADDON.setSetting('password', os.environ.get('ADDON_PASSWORD'))