<commit_before># -*- coding: utf-8 -*-
#
# Copyright (c) 2011 - 2015 -- <NAME> <heuer[at]semagia.com>
# All rights reserved.
#
# License: BSD, see LICENSE.txt for more details.
#
"""\
Test against issue #14.
<https://github.com/heuer/cablemap/issues/#issue/14>

:author:       <NAME> (heuer[at]semagia.com)
:organization: Semagia - <http://www.semagia.com/>
:license:      BSD license
"""
from nose.tools import eq_
from cablemap.core import cable_by_id

_TEST_DATA = (
    # Cable id, expected subject
    ('06GENEVA2654', u"LITTLE PROGRESS AND MUCH CONFUSION AND FRUSTRATION LEAD TO ADJOURNMENT OF HUMAN RIGHTS COUNCIL'S SECOND SESSION"),
    ('06GENEVA1673', u'HRC: SPECIAL SESSION ON PALESTINE'),
    ('07BERN881', u'FM CALMY-REY "TAKES NOTE" OF USG CONCERNS REGARDING IRAN/IAEA AND IRAN/EGL'),
    ('10STATE284', u'ESTABLISHING A DATE FOR THE INAUGURAL POLITICAL MILITARY DIALOGUE WITH LIBYA'),
)

def test_issue14():
    def check(cable, expected):
        eq_(expected, cable.subject)
    for ref, subject in _TEST_DATA:
        yield check, cable_by_id(ref), subject


if __name__ == '__main__':
    import nose
    nose.core.runmodule()<commit_msg>Updated test cases<commit_after># -*- coding: utf-8 -*-
#
# Copyright (c) 2011 - 2015 -- <NAME> <heuer[at]semagia.com>
# All rights reserved.
#
# License: BSD, see LICENSE.txt for more details.
#
"""\
Test against issue #14.
<https://github.com/heuer/cablemap/issues/#issue/14>

:author:       <NAME> (heuer[at]semagia.com)
:organization: Semagia - <http://www.semagia.com/>
:license:      BSD license
"""
from nose.tools import eq_
from cablemap.core import cable_by_id

_TEST_DATA = (
    # Cable id, expected subject
    ('06GENEVA2654', u"LITTLE PROGRESS AND MUCH CONFUSION AND FRUSTRATION LEAD TO ADJOURNMENT OF HUMAN RIGHTS COUNCIL'S SECOND SESSION"),
    ('06GENEVA1673', u'HRC: SPECIAL SESSION ON PALESTINE'),
    ('07BERN881', u'FM CALMY-REY "TAKES NOTE" OF USG CONCERNS REGARDING IRAN/IAEA AND IRAN/EGL'),
    ('10STATE284', u'ESTABLISHING A DATE FOR THE INAUGURAL POLITICAL MILITARY DIALOGUE WITH LIBYA'),
    (u'03TEGUCIGALPA1725', u''),
    (u'04QUITO2502', u''),
    (u'04QUITO2879', u''),
    (u'06ABUJA1587', u''),
    (u'06BANGKOK5133', u''),
    (u'07CAIRO3070', u''),
    (u'08ANKARA588', u''),
    (u'08FREETOWN122', u''),
)

def test_issue14():
    def check(cable, expected):
        eq_(expected, cable.subject)
    for ref, subject in _TEST_DATA:
        yield check, cable_by_id(ref), subject


if __name__ == '__main__':
    import nose
    nose.core.runmodule()
{'fraction_non_alphanumeric': 0.14302554027504913, 'fraction_numerical': 0.047151277013752456, 'mean_word_length': 3.8495238095238093, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '2213687', 'n_tokens_mistral': 1070, 'n_tokens_neox': 966, 'n_words': 247}