Ignore:
Timestamp:
27 May 2014, 12:49:44 (11 years ago)
Author:
uli
Message:

Add test for real functionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_webservices.py

    r11668 r11670  
    4646            attr='passport.jpg')
    4747        storage.createFile(file_id, StringIO(self.image_contents))
     48
     49    def create_fpm_file(self, student, finger_num):
     50        # create some .fpm file for `student` finger `finger_num`
     51        storage = getUtility(IExtFileStore)
     52        file_id = IFileStoreNameChooser(student).chooseName(
     53            attr='%s.fpm' % finger_num)
     54        storage.createFile(file_id, StringIO('FP1FakedMintiaeFile1'))
    4855
    4956    def XMLRPC_post(self, body):
     
    408415        self.assertEqual(result['img_name'], 'passport_K1000000.jpg')
    409416
     417    def test_get_student_fingerprints_fpm(self):
     418        # we get minutiae files if any are avail.
     419        server = ServerProxy('http://mgr:mgrpw@localhost/app')
     420        self.setup_student(self.student)
     421        self.create_fpm_file(self.student, '1')
     422        result = server.get_student_fingerprints(self.student.student_id)
     423        self.assertTrue('1' in result['fingerprints'].keys())
     424        self.assertTrue(
     425            isinstance(result['fingerprints']['1'], xmlrpclib.Binary))
     426
    410427    def test_get_student_fingerprints_block_unauthorized(self):
    411428        # requests from unauthorized users are blocked
Note: See TracChangeset for help on using the changeset viewer.