<commit_before>from __future__ import unicode_literals, division, absolute_import
from builtins import *  # pylint: disable=unused-import, redefined-builtin

import time

import pytest

from flexget.entry import Entry
from flexget.plugins.list.imdb_list import ImdbEntrySet


@pytest.mark.online
@pytest.mark.skip(reason='IMDB Tests are far too unreliable')
class TestIMDBList(object):
    config = """
      tasks: {}
    """

    imdb_config = {'login': '<EMAIL>',
                   'password': '<PASSWORD>',
                   'list': 'watchlist'}

    def test_imdb_list_add(self):
        imdb_set = ImdbEntrySet(self.imdb_config)
        # Clearing existing list
        imdb_set.clear()

        entry = Entry(title='the matrix', imdb_id='tt0133093')

        assert entry not in imdb_set
        imdb_set.add(entry)

        # pls no caching
        imdb_set.session.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
        imdb_set.session.headers['Pragma'] = 'no-cache'
        imdb_set.session.headers['Expires'] = '0'

        # Add delay as imdb seems to cache
        time.sleep(5)
        assert entry in imdb_set

    def test_imdb_list_remove(self):
        imdb_set = ImdbEntrySet(self.imdb_config)
        # Clearing existing list
        imdb_set.clear()

        entry = Entry(title='the matrix', imdb_id='tt0133093')

        assert entry not in imdb_set
        imdb_set.add(entry)

        # Add delay as imdb seems to cache
        time.sleep(5)
        assert entry in imdb_set

        imdb_set.remove(entry)

        # Add delay as imdb seems to cache
        time.sleep(5)
        assert entry not in imdb_set


@pytest.mark.online
class TestIMDBListTypes(object):<commit_msg>disable imdb test<commit_after>from __future__ import unicode_literals, division, absolute_import
from builtins import *  # pylint: disable=unused-import, redefined-builtin

import time

import pytest

from flexget.entry import Entry
from flexget.plugins.list.imdb_list import ImdbEntrySet


@pytest.mark.online
@pytest.mark.skip(reason='IMDB Tests are far too unreliable')
class TestIMDBList(object):
    config = """
      tasks: {}
    """

    imdb_config = {'login': '<EMAIL>',
                   'password': '<PASSWORD>',
                   'list': 'watchlist'}

    def test_imdb_list_add(self):
        imdb_set = ImdbEntrySet(self.imdb_config)
        # Clearing existing list
        imdb_set.clear()

        entry = Entry(title='the matrix', imdb_id='tt0133093')

        assert entry not in imdb_set
        imdb_set.add(entry)

        # pls no caching
        imdb_set.session.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
        imdb_set.session.headers['Pragma'] = 'no-cache'
        imdb_set.session.headers['Expires'] = '0'

        # Add delay as imdb seems to cache
        time.sleep(5)
        assert entry in imdb_set

    def test_imdb_list_remove(self):
        imdb_set = ImdbEntrySet(self.imdb_config)
        # Clearing existing list
        imdb_set.clear()

        entry = Entry(title='the matrix', imdb_id='tt0133093')

        assert entry not in imdb_set
        imdb_set.add(entry)

        # Add delay as imdb seems to cache
        time.sleep(5)
        assert entry in imdb_set

        imdb_set.remove(entry)

        # Add delay as imdb seems to cache
        time.sleep(5)
        assert entry not in imdb_set


@pytest.mark.online
@pytest.mark.skip(reason='IMDB Tests are far too unreliable')
class TestIMDBListTypes(object):
{'fraction_non_alphanumeric': 0.098005698005698, 'fraction_numerical': 0.010256410256410256, 'mean_word_length': 2.6611053180396245, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2471175', 'n_tokens_mistral': 1157, 'n_tokens_neox': 1107, 'n_words': 267}