<commit_before># pylint: disable=wildcard-import,unused-wildcard-import,missing-docstring

from __future__ import absolute_import
from nose.tools import *
from datetime import datetime

from dear_astrid.parser import *

# shortcut
def one_task(fragment):
  return parse_xml(
    '<astrid format="2">{}</astrid>'.format(fragment)
  )[0]

def test_parse_xml():
  assert_raises(AstridValueError, parse_xml, """<astrid format="3"/>""")

  assert_equal(
    one_task(
      '''
      <task title="squid" importance="2" dueDate="1399748400402"
      recurrence="" repeatUntil="0" deleted="0" completed="0"/>
      '''
    ),
    {
      'title':        u'squid',
      'priority':     2,
      'due_date':     datetime(2014,  5, 10, 12,  0,  0, 402000),
      'recurrence':   None,
      'repeat_until': None,
      'completed':    None,<commit_msg>Reorder imports just to be silly<commit_after># pylint: disable=wildcard-import,unused-wildcard-import,missing-docstring

from __future__ import absolute_import
from datetime import datetime

from nose.tools import *

from dear_astrid.parser import *

# shortcut
def one_task(fragment):
  return parse_xml(
    '<astrid format="2">{}</astrid>'.format(fragment)
  )[0]

def test_parse_xml():
  assert_raises(AstridValueError, parse_xml, """<astrid format="3"/>""")

  assert_equal(
    one_task(
      '''
      <task title="squid" importance="2" dueDate="1399748400402"
      recurrence="" repeatUntil="0" deleted="0" completed="0"/>
      '''
    ),
    {
      'title':        u'squid',
      'priority':     2,
      'due_date':     datetime(2014,  5, 10, 12,  0,  0, 402000),
      'recurrence':   None,
      'repeat_until': None,
      'completed':    None,
{'fraction_non_alphanumeric': 0.1488862837045721, 'fraction_numerical': 0.044548651817116064, 'mean_word_length': 3.4803149606299213, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3689623', 'n_tokens_mistral': 626, 'n_tokens_neox': 571, 'n_words': 122}