def test_bool_parsing_false(self): parser = CheddarOutputParser() expected = False result = parser.parse_bool('0') self.assertEquals(expected, result)
def test_decimal_parsing_empty(self): parser = CheddarOutputParser() expected = None result = parser.parse_decimal('') self.assertEquals(expected, result)
def test_decimal_parsing(self): parser = CheddarOutputParser() expected = Decimal('2.345') result = parser.parse_decimal('2.345') self.assertEquals(expected, result)
def test_int_parsing(self): parser = CheddarOutputParser() expected = 234 result = parser.parse_int('234') self.assertEquals(expected, result)
def test_bool_parsing_empty(self): ''' Test boolean parsing with empty string. ''' parser = CheddarOutputParser() expected = None result = parser.parse_bool('') self.assertEquals(expected, result)
def test_decimal_parsing(self): ''' Test decimal parsing with decimal string. ''' parser = CheddarOutputParser() expected = Decimal('2.345') result = parser.parse_decimal('2.345') self.assertEquals(expected, result)
def test_bool_parsing_false(self): ''' Test boolean parsing evaluates to false. ''' parser = CheddarOutputParser() expected = False result = parser.parse_bool('0') self.assertEquals(expected, result)
def test_datetime_parsing_empty(self): ''' Test datetime parsing with empty string. ''' parser = CheddarOutputParser() expected = None result = parser.parse_datetime('') self.assertEquals(expected, result)
def test_int_parsing_empty(self): ''' Test integer parsing with empty string. ''' parser = CheddarOutputParser() expected = None result = parser.parse_int('') self.assertEquals(expected, result)
def test_int_parsing(self): ''' Test integer parsing with integer as string. ''' parser = CheddarOutputParser() expected = 234 result = parser.parse_int('234') self.assertEquals(expected, result)
def test_datetime_parsing(self): parser = CheddarOutputParser() expected = datetime( year=2011, month=1, day=7, hour=20, minute=46, second=43, tzinfo=tzutc(), ) result = parser.parse_datetime('2011-01-07T20:46:43+00:00') self.assertEquals(expected, result)
def test_datetime_parsing_error(self): parser = CheddarOutputParser() parser.parse_datetime('test')
def test_decimal_parsing_error(self): parser = CheddarOutputParser() parser.parse_decimal('test')
def test_bool_parsing_error(self): parser = CheddarOutputParser() parser.parse_bool('test')
def test_int_parsing_error(self): parser = CheddarOutputParser() parser.parse_int('test')
def test_datetime_parsing_error(self): ''' Test datetime parsing with non-date string. ''' parser = CheddarOutputParser() parser.parse_datetime('test')
def test_decimal_parsing_error(self): ''' Test decimal parsing with non-decimal string. ''' parser = CheddarOutputParser() parser.parse_decimal('test')
def test_bool_parsing_error(self): ''' Test boolean parsing with non-boolean string. ''' parser = CheddarOutputParser() parser.parse_bool('test')
def test_int_parsing_error(self): ''' Test integer parsing with non-integer string. ''' parser = CheddarOutputParser() parser.parse_int('test')