fix test error
This commit is contained in:
parent
696f9b3449
commit
8ec2ba96b0
2 changed files with 7 additions and 2 deletions
|
@ -66,7 +66,6 @@ cdef class Detector:
|
||||||
self._detected_charset = ''
|
self._detected_charset = ''
|
||||||
|
|
||||||
def feed(self, char *msg):
|
def feed(self, char *msg):
|
||||||
# TODO: Support py3k
|
|
||||||
cdef int length
|
cdef int length
|
||||||
cdef int result
|
cdef int result
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
from nose.tools import eq_
|
from nose.tools import eq_
|
||||||
|
|
||||||
import cchardet
|
import cchardet
|
||||||
|
@ -80,6 +82,10 @@ class TestCChardet():
|
||||||
|
|
||||||
def test_detector_noresult(self):
|
def test_detector_noresult(self):
|
||||||
detector = cchardet.Detector()
|
detector = cchardet.Detector()
|
||||||
detector.feed('0')
|
if sys.version_info[0] < 3:
|
||||||
|
zero = '0'
|
||||||
|
else:
|
||||||
|
zero = b'0'
|
||||||
|
detector.feed(zero)
|
||||||
eq_(detector.done, False)
|
eq_(detector.done, False)
|
||||||
eq_(detector.result, {'encoding': None, 'confidence': None})
|
eq_(detector.result, {'encoding': None, 'confidence': None})
|
||||||
|
|
Loading…
Reference in a new issue