Esempio n. 1
0
            if "certificate verify failed" in str(error):
                print("Cannot verify certificate for {0}".format(_provider.name))
            else:
                print("SSLError on {0}: {1}".format(_provider.name, str(error)))
                raise
        except requests.exceptions.Timeout:
            print("Provider timed out")
        except requests.exceptions.RequestException:
            raise

    return _connectivity_test


class SniTests(unittest.TestCase):
    pass


if __name__ == "__main__":
    print("==================")
    print("STARTING - Provider Connectivity TESTS and SSL/SNI")
    print("==================")
    print("######################################################################")
    # Just checking all providers - we should make this error on non-existent urls.
    for provider in [p for p in providers.makeProviderList()]:
        test_name = "test_{0}".format(provider.name)
        test = generator(provider)
        setattr(SniTests, test_name, test)

    SUITE = unittest.TestLoader().loadTestsFromTestCase(SniTests)
    unittest.TextTestRunner(verbosity=2).run(SUITE)
Esempio n. 2
0
# =================


settings.showList = []
settings.QUALITY_DEFAULT = 4  # hdtv
settings.SEASON_FOLDERS_DEFAULT = 0

settings.NAMING_PATTERN = ""
settings.NAMING_ABD_PATTERN = ""
settings.NAMING_SPORTS_PATTERN = ""
settings.NAMING_MULTI_EP = 1

settings.TV_DOWNLOAD_DIR = PROCESSING_DIR

# settings.PROVIDER_ORDER = ["sick_beard_index"]
settings.providerList = providers.makeProviderList()

settings.DATA_DIR = TEST_DIR
settings.CONFIG_FILE = os.path.join(settings.DATA_DIR, "config.ini")
settings.CFG = ConfigObj(settings.CONFIG_FILE, encoding="UTF-8", indent_type="  ")
settings.GUI_NAME = "slick"

settings.BRANCH = sickchill.oldbeard.config.check_setting_str(settings.CFG, "General", "branch")
settings.CUR_COMMIT_HASH = sickchill.oldbeard.config.check_setting_str(settings.CFG, "General", "cur_commit_hash")
settings.GIT_USERNAME = sickchill.oldbeard.config.check_setting_str(settings.CFG, "General", "git_username")
settings.GIT_TOKEN = sickchill.oldbeard.config.check_setting_str(settings.CFG, "General", "git_token_password", censor_log=True)

settings.LOG_DIR = os.path.join(TEST_DIR, "Logs")
sickchill.logger.log_file = os.path.join(settings.LOG_DIR, "test_sickchill.log")
create_test_log_folder()