예제 #1
0
 def test_parse_decimal_dot_only_negative_empty_value(self):
     # Given
     message = _InputMessage._create('.')
     parser = _ReconParser()
     # When
     actual = _DecimalParser._parse(message, parser, sign_output=-1)
     # Then
     self.assertIsInstance(actual, Num)
     self.assertEqual(-0.0, actual.value)
예제 #2
0
 def test_parse_decimal_empty_positive_empty_value(self):
     # Given
     message = _InputMessage._create('')
     parser = _ReconParser()
     # When
     actual = _DecimalParser._parse(message, parser)
     # Then
     self.assertIsInstance(actual, Num)
     self.assertEqual(0.0, actual.value)
예제 #3
0
 def test_parse_decimal_dot_only_positive_existing_value(self):
     # Given
     message = _InputMessage._create('.')
     parser = _ReconParser()
     value_output = 17
     # When
     actual = _DecimalParser._parse(message, parser, value_output)
     # Then
     self.assertIsInstance(actual, Num)
     self.assertEqual(17.0, actual.value)
예제 #4
0
 def test_parse_decimal_empty_negative_existing_value(self):
     # Given
     message = _InputMessage._create('')
     parser = _ReconParser()
     value_output = -16
     # When
     actual = _DecimalParser._parse(message,
                                    parser,
                                    value_output,
                                    sign_output=-1)
     # Then
     self.assertIsInstance(actual, Num)
     self.assertEqual(-16.0, actual.value)