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

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

        self.assertEquals(expected, result)
Exemplo n.º 3
0
    def test_decimal_parsing_empty(self):
        parser = CheddarOutputParser()

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

        self.assertEquals(expected, result)
Exemplo n.º 4
0
    def test_decimal_parsing(self):
        parser = CheddarOutputParser()

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

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

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

        self.assertEquals(expected, result)
Exemplo n.º 8
0
    def test_decimal_parsing_empty(self):
        parser = CheddarOutputParser()

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

        self.assertEquals(expected, result)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 17
0
    def test_datetime_parsing_error(self):
        parser = CheddarOutputParser()

        parser.parse_datetime('test')
Exemplo n.º 18
0
 def test_decimal_parsing_error(self):
     parser = CheddarOutputParser()
     
     parser.parse_decimal('test')
Exemplo n.º 19
0
    def test_bool_parsing_error(self):
        parser = CheddarOutputParser()

        parser.parse_bool('test')
Exemplo n.º 20
0
 def test_int_parsing_error(self):
     parser = CheddarOutputParser()
     
     parser.parse_int('test')
Exemplo n.º 21
0
    def test_int_parsing_error(self):
        parser = CheddarOutputParser()

        parser.parse_int('test')
Exemplo n.º 22
0
 def test_bool_parsing_error(self):
     parser = CheddarOutputParser()
     
     parser.parse_bool('test')
Exemplo n.º 23
0
    def test_decimal_parsing_error(self):
        parser = CheddarOutputParser()

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

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

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

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

        parser.parse_int('test')