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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        parser.parse_int('test')