<commit_before>
try:
    import unittest2 as unittest
except ImportError:
    import unittest

from datetime import datetime

from assembla import parsers


class ParserTest(unittest.TestCase):
    def test_date_fields(self):
        self.assertEquals(
            {'restricted_date': datetime(2012, 1, 3, 0, 0).date()},
            parsers.parse({'restricted_date': '2012-01-03'})
        )

    def test_datetime_fields(self):
        self.assertEquals(
            {'created_on': datetime(2011, 9, 2, 10, 21, 48)},
            parsers.parse({'created_on': '2011-09-02T10:21:48Z'})
        )<commit_msg>Adding float field test.<commit_after>
try:
    import unittest2 as unittest
except ImportError:
    import unittest

from datetime import datetime

from assembla import parsers


class ParserTest(unittest.TestCase):
    def test_date_fields(self):
        self.assertEquals(
            {'restricted_date': datetime(2012, 1, 3, 0, 0).date()},
            parsers.parse({'restricted_date': '2012-01-03'})
        )

    def test_datetime_fields(self):
        self.assertEquals(
            {'created_on': datetime(2011, 9, 2, 10, 21, 48)},
            parsers.parse({'created_on': '2011-09-02T10:21:48Z'})
        )

    def test_float_fields(self):
        self.assertEquals(
            {'estimate': 6.5},
            parsers.parse({'estimate': '6.5'})
        )
{'fraction_non_alphanumeric': 0.12773722627737227, 'fraction_numerical': 0.06569343065693431, 'mean_word_length': 2.685483870967742, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6678410', 'n_tokens_mistral': 509, 'n_tokens_neox': 421, 'n_words': 96}