def test_process_template_can_parse_ill_formed_template(self):
    tf = self.get_test_loc('analysis/ill_formed_template/text.txt')
    lines = unicode_text_lines(tf)
    result = list(self.template_parsing(lines))
    expected_gaps = [30, 10, 60, 70, 20]
    result_gaps = [x.gap for x in result if x.gap]
    assert (expected_gaps == result_gaps)
    et = self.get_test_loc('analysis/ill_formed_template/expected_grams.json')
    result_dicts = [t._asdict() for t in result]
    regen = False
    if regen:
        with codecs.open(et, 'w', encoding='utf-8') as out:
            json.dump(result_dicts, out, indent=2)
    with codecs.open(et, encoding='utf-8') as inp:
        expected = json.load(inp)
    assert (expected == result_dicts)
def test_process_template_can_parse_ill_formed_template(self):
    tf = self.get_test_loc('analysis/ill_formed_template/text.txt')
    lines = unicode_text_lines(tf)
    result = list(self.template_parsing(lines))
    expected_gaps = [30, 10, 60, 70, 20]
    result_gaps = [x.gap for x in result if x.gap]
    assert (expected_gaps == result_gaps)
    et = self.get_test_loc('analysis/ill_formed_template/expected_grams.json')
    result_dicts = [t._asdict() for t in result]
    regen = False
    if regen:
        with codecs.open(et, 'w', encoding='utf-8') as out:
            json.dump(result_dicts, out, indent=2)
    with codecs.open(et, encoding='utf-8') as inp:
        expected = json.load(inp)
    assert (expected == result_dicts)