Example #1
0
    def test_ocr_multiplas_contas(self):
        accounts = """\
 _  _  _  _  _  _  _  _  _ 
| || || || || || || || || |
|_||_||_||_||_||_||_||_||_|

                           
  |  |  |  |  |  |  |  |  |
  |  |  |  |  |  |  |  |  |
"""
  
        result = """\
000000000
111111111"""

        self.assertEqual(ocr(accounts), result)
Example #2
0
    def test_ocr_multiplas_contas(self):
        accounts = """\
 _  _  _  _  _  _  _  _  _ 
| || || || || || || || || |
|_||_||_||_||_||_||_||_||_|

                           
  |  |  |  |  |  |  |  |  |
  |  |  |  |  |  |  |  |  |
"""

        result = """\
000000000
111111111"""

        self.assertEqual(ocr(accounts), result)
Example #3
0
    def test_multiple_accounts(self):
        accounts = """\
 _  _  _  _  _  _  _  _    
| || || || || || || ||_   |
|_||_||_||_||_||_||_| _|  |
                           
    _  _  _  _  _  _     _ 
|_||_|| || ||_   |  |  | _ 
  | _||_||_||_|  |  |  | _|
                           
 _  _  _  _  _  _  _  _  _ 
| || || || || || || ||_   |
|_||_||_||_||_||_||_| _|  |
                           """
        result = """\
000000051
49006771? ILL
000000057 ERR"""
        
        self.assertEqual(ocr(accounts, validate=True), result)
Example #4
0
    def test_multiple_accounts(self):
        accounts = """\
 _  _  _  _  _  _  _  _    
| || || || || || || ||_   |
|_||_||_||_||_||_||_| _|  |
                           
    _  _  _  _  _  _     _ 
|_||_|| || ||_   |  |  | _ 
  | _||_||_||_|  |  |  | _|
                           
 _  _  _  _  _  _  _  _  _ 
| || || || || || || ||_   |
|_||_||_||_||_||_||_| _|  |
                           """
        result = """\
000000051
49006771? ILL
000000057 ERR"""

        self.assertEqual(ocr(accounts, validate=True), result)
Example #5
0
   def test_ocr1(self):
       entrada = '''\
  
 |
 |'''
       self.assertEquals('1', ocr(entrada))
Example #6
0
    def test_ocr9(self):
        entrada = '''\
 _ 
|_|
 _|'''
        self.assertEquals('9', ocr(entrada))
Example #7
0
    def test_ocr0(self):
        entrada = '''\
 _ 
| |
|_|'''
        self.assertEquals('0', ocr(entrada))
Example #8
0
    def test_ocr4(self):
        entrada = '''\
   
|_|
  |'''
        self.assertEquals('4', ocr(entrada))
Example #9
0
    def test_ocr0(self):
        entrada = '''\
 _ 
| |
|_|'''
        self.assertEquals('0', ocr(entrada))
Example #10
0
    def test_ocr5(self):
        entrada = '''\
 _ 
|_ 
 _|'''
        self.assertEquals('5', ocr(entrada))
Example #11
0
    def test_ocr4(self):
        entrada = '''\
   
|_|
  |'''
        self.assertEquals('4', ocr(entrada))
Example #12
0
    def test_ocr3(self):
        entrada = '''\
 _ 
 _|
 _|'''
        self.assertEquals('3', ocr(entrada))
Example #13
0
    def test_ocr2(self):
        entrada = '''\
 _ 
 _|
|_ '''
        self.assertEquals('2', ocr(entrada))
Example #14
0
   def test_ocr1(self):
       entrada = '''\
  
 |
 |'''
       self.assertEquals('1', ocr(entrada))
Example #15
0
    def test_ocr2(self):
        entrada = '''\
 _ 
 _|
|_ '''
        self.assertEquals('2', ocr(entrada))
Example #16
0
    def test_ocr7(self):
        entrada = '''\
 _ 
  |
  |'''
        self.assertEquals('7', ocr(entrada))
Example #17
0
    def test_ocr3(self):
        entrada = '''\
 _ 
 _|
 _|'''
        self.assertEquals('3', ocr(entrada))
Example #18
0
    def test_ocr9(self):
        entrada = '''\
 _ 
|_|
 _|'''
        self.assertEquals('9', ocr(entrada))
Example #19
0
    def test_ocr5(self):
        entrada = '''\
 _ 
|_ 
 _|'''
        self.assertEquals('5', ocr(entrada))
Example #20
0
    def test_ocr_dois_digitos_29(self):
        entrada = '''\
 _  _ 
 _||_|
|_  _|'''
        self.assertEquals('29', ocr(entrada))
Example #21
0
    def test_ocr7(self):
        entrada = '''\
 _ 
  |
  |'''
        self.assertEquals('7', ocr(entrada))
Example #22
0
    def test_ocr_tres_digitos_351(self):
        entrada = '''\
 _  _    
 _||_   |
 _| _|  |'''
        self.assertEquals('351', ocr(entrada))
Example #23
0
    def test_ocr_dois_digitos_29(self):
        entrada = '''\
 _  _ 
 _||_|
|_  _|'''
        self.assertEquals('29', ocr(entrada))
Example #24
0
    def test_ocr_tres_digitos_351(self):
        entrada = '''\
 _  _    
 _||_   |
 _| _|  |'''
        self.assertEquals('351', ocr(entrada))