

def test_get_surrounding_bracket(self):
    get = self.get_parser

    def without_mustclose(parser):
        return parser.get_surrounding_brackets(mustclose=False)

    def with_mustclose(parser):
        return parser.get_surrounding_brackets(mustclose=True)
    p = get('3.2')
    self.assertIsNone(with_mustclose(p))
    self.assertIsNone(without_mustclose(p))
    p = get('5.6')
    self.assertTupleEqual(without_mustclose(p), ('5.4', '5.25'))
    self.assertTupleEqual(without_mustclose(p), with_mustclose(p))
    p = get('5.23')
    self.assertTupleEqual(without_mustclose(p), ('5.21', '5.24'))
    self.assertTupleEqual(without_mustclose(p), with_mustclose(p))
    p = get('6.15')
    self.assertTupleEqual(without_mustclose(p), ('6.4', '6.end'))
    self.assertIsNone(with_mustclose(p))
    p = get('9.end')
    self.assertIsNone(with_mustclose(p))
    self.assertIsNone(without_mustclose(p))

dataset/ETHPy150Open francelabs/datafari/windows/python/Lib/idlelib/idle_test/test_hyperparser.py HyperParserTest.test_get_surrounding_bracket/original