# Path: moedjpack/moepad/mputils.py
# def sub_dict(somedict, somekeys, default=None):
# def loggerInit(logfile):
# def utcnow():
# def _deletePrefix(key):
# def create_default_db():


import time
import moedjpack.moepad.update as update
from moedjpack.moepad.mputils import rs, logger, _deletePrefix
from moedjpack.moepad.mpdefs import *
    assert u"物语系列" in real_categories


def test_filterForbiddenItems():
    rs.sadd(FORBIDDENS, u"神原骏河".encode('utf-8'))
    rs.sadd(FORBIDDENS, u"R18".encode('utf-8'))
    rs.sadd(FORBIDDENS, u"R-18".encode('utf-8'))

    assert not update.filterForbiddenItems(u"Ahe颜")
    assert not update.filterForbiddenItems(u'援助交际')
    assert not update.filterForbiddenItems(u"神原骏河")
    assert update.filterForbiddenItems(u"猫物语")

    rs.srem(FORBIDDENS, u"神原骏河".encode('utf-8'))
    rs.srem(FORBIDDENS, u"R18".encode('utf-8'))
    rs.srem(FORBIDDENS, u"R-18".encode('utf-8'))


def test_filterRedirectedItems():
    assert not update.filterRedirectedItems(u"百合(消歧义)")
    assert update.filterRedirectedItems(u"NTR")


def test_filterExistedItems():
    _deletePrefix(NEWITEM)
    _deletePrefix(EDITED)
    rs.delete(VERIFYING_SET)


    rs.set(NEWITEM+"newitem", "newitem")

# Path: moedjpack/moepad/mputils.py
# def sub_dict(somedict, somekeys, default=None):
# def loggerInit(logfile):
# def utcnow():
# def _deletePrefix(key):
# def create_default_db():


# Path: moedjpack/moepad/tests/test_update.py
import time
import moedjpack.moepad.update as update
from moedjpack.moepad.mputils import rs, logger, _deletePrefix
from moedjpack.moepad.mpdefs import *

    assert u"物语系列" in real_categories


def test_filterForbiddenItems():
    rs.sadd(FORBIDDENS, u"神原骏河".encode('utf-8'))
    rs.sadd(FORBIDDENS, u"R18".encode('utf-8'))
    rs.sadd(FORBIDDENS, u"R-18".encode('utf-8'))

    assert not update.filterForbiddenItems(u"Ahe颜")
    assert not update.filterForbiddenItems(u'援助交际')
    assert not update.filterForbiddenItems(u"神原骏河")
    assert update.filterForbiddenItems(u"猫物语")

    rs.srem(FORBIDDENS, u"神原骏河".encode('utf-8'))
    rs.srem(FORBIDDENS, u"R18".encode('utf-8'))
    rs.srem(FORBIDDENS, u"R-18".encode('utf-8'))


def test_filterRedirectedItems():
    assert not update.filterRedirectedItems(u"百合(消歧义)")
    assert update.filterRedirectedItems(u"NTR")


def test_filterExistedItems():
    _deletePrefix(NEWITEM)
    _deletePrefix(EDITED)
    rs.delete(VERIFYING_SET)


    rs.set(NEWITEM+"newitem", "newitem")

    rs.set(EDITED+"edited", "edited")