Exemple #1
0
 def test_bool_parsing_false(self):
     parser = CheddarOutputParser()
     
     expected = False
     result = parser.parse_bool('0')
     
     self.assertEquals(expected, result)
Exemple #2
0
    def test_bool_parsing_false(self):
        parser = CheddarOutputParser()

        expected = False
        result = parser.parse_bool('0')

        self.assertEquals(expected, result)
Exemple #3
0
    def test_decimal_parsing_empty(self):
        parser = CheddarOutputParser()

        expected = None
        result = parser.parse_decimal('')

        self.assertEquals(expected, result)
Exemple #4
0
    def test_decimal_parsing(self):
        parser = CheddarOutputParser()

        expected = Decimal('2.345')
        result = parser.parse_decimal('2.345')

        self.assertEquals(expected, result)
Exemple #5
0
 def test_int_parsing(self):
     parser = CheddarOutputParser()
     
     expected = 234
     result = parser.parse_int('234')
     
     self.assertEquals(expected, result)
Exemple #6
0
 def test_decimal_parsing(self):
     parser = CheddarOutputParser()
     
     expected = Decimal('2.345')
     result = parser.parse_decimal('2.345')
     
     self.assertEquals(expected, result)
Exemple #7
0
    def test_int_parsing(self):
        parser = CheddarOutputParser()

        expected = 234
        result = parser.parse_int('234')

        self.assertEquals(expected, result)
Exemple #8
0
    def test_decimal_parsing_empty(self):
        parser = CheddarOutputParser()

        expected = None
        result = parser.parse_decimal('')

        self.assertEquals(expected, result)
Exemple #9
0
    def test_bool_parsing_empty(self):
        ''' Test boolean parsing with empty string. '''
        parser = CheddarOutputParser()

        expected = None
        result = parser.parse_bool('')

        self.assertEquals(expected, result)
Exemple #10
0
    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)
Exemple #11
0
    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)
Exemple #12
0
    def test_datetime_parsing_empty(self):
        ''' Test datetime parsing with empty string. '''
        parser = CheddarOutputParser()

        expected = None
        result = parser.parse_datetime('')

        self.assertEquals(expected, result)
Exemple #13
0
    def test_int_parsing_empty(self):
        ''' Test integer parsing with empty string. '''
        parser = CheddarOutputParser()

        expected = None
        result = parser.parse_int('')

        self.assertEquals(expected, result)
Exemple #14
0
    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)
Exemple #15
0
    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)
Exemple #16
0
 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)
Exemple #17
0
    def test_datetime_parsing_error(self):
        parser = CheddarOutputParser()

        parser.parse_datetime('test')
Exemple #18
0
 def test_decimal_parsing_error(self):
     parser = CheddarOutputParser()
     
     parser.parse_decimal('test')
Exemple #19
0
    def test_bool_parsing_error(self):
        parser = CheddarOutputParser()

        parser.parse_bool('test')
Exemple #20
0
 def test_int_parsing_error(self):
     parser = CheddarOutputParser()
     
     parser.parse_int('test')
Exemple #21
0
    def test_int_parsing_error(self):
        parser = CheddarOutputParser()

        parser.parse_int('test')
Exemple #22
0
 def test_bool_parsing_error(self):
     parser = CheddarOutputParser()
     
     parser.parse_bool('test')
Exemple #23
0
    def test_decimal_parsing_error(self):
        parser = CheddarOutputParser()

        parser.parse_decimal('test')
Exemple #24
0
    def test_datetime_parsing_error(self):
        ''' Test datetime parsing with non-date string. '''
        parser = CheddarOutputParser()

        parser.parse_datetime('test')
Exemple #25
0
 def test_datetime_parsing_error(self):
     parser = CheddarOutputParser()
     
     parser.parse_datetime('test')
Exemple #26
0
    def test_decimal_parsing_error(self):
        ''' Test decimal parsing with non-decimal string. '''
        parser = CheddarOutputParser()

        parser.parse_decimal('test')
Exemple #27
0
    def test_bool_parsing_error(self):
        ''' Test boolean parsing with non-boolean string. '''
        parser = CheddarOutputParser()

        parser.parse_bool('test')
Exemple #28
0
    def test_int_parsing_error(self):
        ''' Test integer parsing with non-integer string. '''
        parser = CheddarOutputParser()

        parser.parse_int('test')