def test_parse_check_delimiters_with_custom_delim(self): parser = StrCalculatorParser() result = parser.parse(";\n1;2").delimiters self.assertEqual(result, ";")
def test_parse_check_numbers_with_default_delim(self): parser = StrCalculatorParser() result = parser.parse("1,2").numbers self.assertEqual(result, [1, 2])
def test_parse_check_delimiters_with_default_delim(self): parser = StrCalculatorParser() result = parser.parse("1,2").delimiters self.assertEqual(result, ["\n", ","])
def test_parse_check_string_with_default_delim(self): parser = StrCalculatorParser() result = parser.parse("1,2").string self.assertEqual(result, "1,2")
def test_can_create_parser(self): parser = StrCalculatorParser() self.assertTrue(isinstance(parser, StrCalculatorParser))
def test_parse_check_numstring_with_custom_delim(self): parser = StrCalculatorParser() result = parser.parse(";\n1;2").numstring self.assertEqual(result, "1,2")