<commit_before># coding: utf-8

import time, copy
from tests.shared import  getEmptyDeck
from anki.utils import  intTime
from anki.hooks import addHook

def checkRevIvl(d, c, targetIvl):
    min, max = d.sched._fuzzIvlRange(targetIvl)
    return min <= c.ivl <= max

def test_basics():
    d = getEmptyDeck()
    d.reset()
    assert not d.sched.getCard()

def test_new():
    d = getEmptyDeck()
    d.reset()
    assert d.sched.newCount == 0
    # add a note
    f = d.newNote()
    f['Front'] = u"one"; f['Back'] = u"two"
    d.addNote(f)<commit_msg>note rollover problem in unit tests<commit_after># coding: utf-8

import time, copy, sys
from tests.shared import  getEmptyDeck
from anki.utils import  intTime
from anki.hooks import addHook

def test_clock():
    d = getEmptyDeck()
    if (d.sched.dayCutoff - intTime()) < 10*60:
        raise Exception("Unit tests will fail around the day rollover.")

def checkRevIvl(d, c, targetIvl):
    min, max = d.sched._fuzzIvlRange(targetIvl)
    return min <= c.ivl <= max

def test_basics():
    d = getEmptyDeck()
    d.reset()
    assert not d.sched.getCard()

def test_new():
    d = getEmptyDeck()
    d.reset()
    assert d.sched.newCount == 0
    # add a note
    f = d.newNote()
    f['Front'] = u"one"; f['Back'] = u"two"
    d.addNote(f)
{'fraction_non_alphanumeric': 0.13292117465224113, 'fraction_numerical': 0.0061823802163833074, 'mean_word_length': 3.124203821656051, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 3, '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': '7419527', 'n_tokens_mistral': 481, 'n_tokens_neox': 476, 'n_words': 132}