def test_right(self): """ Tests extract_substring when direction='right'. """ string = '$_id_1' actual = parserutils.extract_substring(string, '$', '_', True) expected = '_id' self.assertEqual(actual, expected)
def test_default(self): """ Tests extract_substring for the default setting. """ string = 'dup key : { "123" }' actual = parserutils.extract_substring(string, ':', '}') expected = ' { "123" ' self.assertEqual(actual, expected)