def testDefaultParsing(self): stream = 'some meaningful value1 something else skippable value2 still more skip.' start = len('some meaningful ') self.assertTrue(DefaultParser.is_applicable(stream[start]), 'Should be parsable.') _, value, _ = DefaultParser.parse(start, stream) self.assertEqual(value, 'value1') start = len('some meaningful value1 something else skippable ') self.assertTrue(DefaultParser.is_applicable(stream[start]), 'Should be parsable.') _, value, _ = DefaultParser.parse(start, stream) self.assertEqual(value, 'value2')
def testEndStringParsing(self): stream = 'some meaningful value1' start = len('some meaningful ') self.assertTrue(DefaultParser.is_applicable(stream[start]), 'Should be parsable.') _, value, _ = DefaultParser.parse(start, stream) self.assertEqual(value, 'value1')