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