Exemplo n.º 1
0
    def test_get_client(self):
        client = tvdbapi_client.get_client()
        self.assertIsInstance(client, api.TVDBClient)

        # validate client not configured
        self.assertRaises(exceptions.TVDBRequestException,
                          client.authenticate)
Exemplo n.º 2
0
    def test_get_configured_client(self):
        client = tvdbapi_client.get_client(
            apikey='abc123xyz456',
            username='******',
            userpass='******',
            service_url='https://api-dev.thetvdb.com',
            verify_ssl_certs=True,
            select_first=False)
        self.assertIsInstance(client, api.TVDBClient)

        # validate auth is successful
        client.authenticate()
        self.assertIsNotNone(client._token_timer)

        cfgfile = self.create_tempfiles(
            [('tvdbapi_client', ''.join(self.cfg_data))])[0]
        self.addCleanup(shutil.rmtree, os.path.dirname(cfgfile), True)

        client = tvdbapi_client.get_client(config_file=cfgfile)
        self.assertIsInstance(client, api.TVDBClient)
Exemplo n.º 3
0
    def test_get_configured_client(self):
        client = tvdbapi_client.get_client(
            apikey='abc123xyz456',
            username='******',
            userpass='******',
            service_url='https://api-dev.thetvdb.com',
            verify_ssl_certs=True,
            select_first=False)
        self.assertIsInstance(client, api.TVDBClient)

        # validate auth is successful
        client.authenticate()
        self.assertIsNotNone(client._token_timer)

        cfgfile = self.create_tempfiles([('tvdbapi_client',
                                          ''.join(self.cfg_data))])[0]
        self.addCleanup(shutil.rmtree, os.path.dirname(cfgfile), True)

        client = tvdbapi_client.get_client(config_file=cfgfile)
        self.assertIsInstance(client, api.TVDBClient)
Exemplo n.º 4
0
    def test_get_configured_client(self):
        client = tvdbapi_client.get_client(
            apikey=os.environ.get('TEST_API_KEY'),
            username=os.environ.get('TEST_API_USER'),
            userpass=os.environ.get('TEST_API_PASSWORD'),
            service_url='https://api-dev.thetvdb.com',
            verify_ssl_certs=True,
            select_first=False)
        self.assertIsInstance(client, api.TVDBClient)

        # validate auth is successful
        client.authenticate()
        self.assertIsNotNone(client._token_timer)
Exemplo n.º 5
0
    def test_get_configured_client(self):
        client = tvdbapi_client.get_client(
            apikey=os.environ.get('TEST_API_KEY'),
            username=os.environ.get('TEST_API_USER'),
            userpass=os.environ.get('TEST_API_PASSWORD'),
            service_url='https://api-dev.thetvdb.com',
            verify_ssl_certs=True,
            select_first=False)
        self.assertIsInstance(client, api.TVDBClient)

        # validate auth is successful
        client.authenticate()
        self.assertIsNotNone(client._token_timer)
Exemplo n.º 6
0
    def test_get_client(self):
        client = tvdbapi_client.get_client()
        self.assertIsInstance(client, api.TVDBClient)

        # validate client not configured
        self.assertRaises(exceptions.TVDBRequestException, client.authenticate)