Пример #1
0
def test_subpart_designation_no_subpart():
    designate_token = tokens.Verb(tokens.Verb.DESIGNATE, True)
    token_list = _paragraph_token_list()
    tokenized = [designate_token, token_list]

    toks, subpart_added = amdparser.subpart_designation(tokenized)
    assert not subpart_added
Пример #2
0
def test_subpart_designation_no_subpart():
    designate_token = tokens.Verb(tokens.Verb.DESIGNATE, True)
    token_list = _paragraph_token_list()
    tokenized = [designate_token, token_list]

    toks, subpart_added = amdparser.subpart_designation(tokenized)
    assert not subpart_added
    def test_subpart_designation_no_subpart(self):
        designate_token = tokens.Verb(tokens.Verb.DESIGNATE, True)
        token_list = self.paragraph_token_list()
        tokenized = [designate_token, token_list]

        toks, subpart_added = amdparser.subpart_designation(tokenized)
        self.assertFalse(subpart_added)
Пример #4
0
def test_subpart_designation():
    designate_token = tokens.Verb(tokens.Verb.DESIGNATE, True)
    token_list = _paragraph_token_list()
    context = tokens.Context(['Subpart', 'A'])

    tokenized = [designate_token, token_list, context]

    toks, subpart_added = amdparser.subpart_designation(tokenized)
    assert subpart_added

    paragraph_found = False
    for t in toks:
        assert not isinstance(t, tokens.Context)

        if isinstance(t, tokens.Paragraph):
            assert t.label == ['Subpart', 'A']
            paragraph_found = True

    assert paragraph_found
Пример #5
0
def test_subpart_designation():
    designate_token = tokens.Verb(tokens.Verb.DESIGNATE, True)
    token_list = _paragraph_token_list()
    context = tokens.Context(['Subpart', 'A'])

    tokenized = [designate_token, token_list, context]

    toks, subpart_added = amdparser.subpart_designation(tokenized)
    assert subpart_added

    paragraph_found = False
    for t in toks:
        assert not isinstance(t, tokens.Context)

        if isinstance(t, tokens.Paragraph):
            assert t.label == ['Subpart', 'A']
            paragraph_found = True

    assert paragraph_found
    def test_subpart_designation(self):
        designate_token = tokens.Verb(tokens.Verb.DESIGNATE, True)
        token_list = self.paragraph_token_list()
        context = tokens.Context(['Subpart', 'A'])

        tokenized = [designate_token, token_list, context]

        toks, subpart_added = amdparser.subpart_designation(tokenized)
        self.assertTrue(subpart_added)

        paragraph_found = False
        for t in toks:
            self.assertFalse(isinstance(t, tokens.Context))

            if isinstance(t, tokens.Paragraph):
                self.assertEqual(t.label, ['Subpart', 'A'])
                paragraph_found = True

        self.assertTrue(paragraph_found)