def test_context_to_paragraph_exceptions(self):
        tokenized = [tokens.Verb(tokens.Verb.PUT, active=True), tokens.Context(["2"]), tokens.Paragraph(["3"])]
        converted = diff.context_to_paragraph(tokenized)
        self.assertEqual(tokenized, converted)

        tokenized = [
            tokens.Verb(tokens.Verb.PUT, active=True),
            tokens.Context(["2"]),
            tokens.TokenList([tokens.Paragraph(["3"])]),
        ]
        converted = diff.context_to_paragraph(tokenized)
        self.assertEqual(tokenized, converted)
Beispiel #2
0
    def test_context_to_paragraph_exceptions(self):
        tokenized = [
            tokens.Verb(tokens.Verb.PUT, active=True),
            tokens.Context(['2']),
            tokens.Paragraph(['3'])
        ]
        converted = diff.context_to_paragraph(tokenized)
        self.assertEqual(tokenized, converted)

        tokenized = [
            tokens.Verb(tokens.Verb.PUT, active=True),
            tokens.Context(['2']),
            tokens.TokenList([tokens.Paragraph(['3'])])
        ]
        converted = diff.context_to_paragraph(tokenized)
        self.assertEqual(tokenized, converted)
 def test_context_to_paragraph(self):
     tokenized = [
         tokens.Context(['1']),
         tokens.Verb(tokens.Verb.PUT, active=True),
         tokens.Context(['2']),
         tokens.Context(['3'], certain=True),
         tokens.Context(['4'])
     ]
     converted = diff.context_to_paragraph(tokenized)
     self.assertEqual(converted, [
         tokens.Context(['1']),
         tokens.Verb(tokens.Verb.PUT, active=True),
         tokens.Paragraph(part='2'),
         tokens.Context(['3'], certain=True),
         tokens.Paragraph(part='4')
     ])
Beispiel #4
0
 def test_context_to_paragraph(self):
     tokenized = [
         tokens.Context(['1']),
         tokens.Verb(tokens.Verb.PUT, active=True),
         tokens.Context(['2']),
         tokens.Context(['3'], certain=True),
         tokens.Context(['4'])
     ]
     converted = diff.context_to_paragraph(tokenized)
     self.assertEqual(converted, [
         tokens.Context(['1']),
         tokens.Verb(tokens.Verb.PUT, active=True),
         tokens.Paragraph(['2']),
         tokens.Context(['3'], certain=True),
         tokens.Paragraph(['4'])
     ])
 def test_context_to_paragraph(self):
     tokenized = [
         tokens.Context(["1"]),
         tokens.Verb(tokens.Verb.PUT, active=True),
         tokens.Context(["2"]),
         tokens.Context(["3"], certain=True),
         tokens.Context(["4"]),
     ]
     converted = diff.context_to_paragraph(tokenized)
     self.assertEqual(
         converted,
         [
             tokens.Context(["1"]),
             tokens.Verb(tokens.Verb.PUT, active=True),
             tokens.Paragraph(["2"]),
             tokens.Context(["3"], certain=True),
             tokens.Paragraph(["4"]),
         ],
     )