예제 #1
0
 def download_fingerprint(self, path):
     student_id = self.root.f_student_id
     Logger.info(
         "waeup.identifier: downloading fingerprint of '%s'" % student_id)
     username = self.config.get('Server', 'waeup_user')
     password = self.config.get('Server', 'waeup_passwd')
     netloc = self.config.get('Server', 'waeup_url')
     url = get_url(netloc, username, password)
     call_in_background(
         callable=get_fingerprints,
         args=(url, student_id),
         callback=self.download_finished)
예제 #2
0
    def upload_fingerprint(self, path):
        """Do the actual upload.

        `path` is the path to the `.fpm` file to be uploaded.
        """
        student_id = self.root.f_student_id
        Logger.info(
            "waeup.identifier: uploading fingerprint for '%s'" % student_id)
        username = self.config.get('Server', 'waeup_user')
        password = self.config.get('Server', 'waeup_passwd')
        netloc = self.config.get('Server', 'waeup_url')
        url = get_url(netloc, username, password)
        call_in_background(
            callable=store_fingerprint,
            args=(url, student_id, 1, path),
            callback=self.upload_finished)
예제 #3
0
 def test_get_url_paths(self):
     # paths are kept in URLs
     assert get_url(
         'https://*****:*****@localhost:8080/app"
예제 #4
0
 def get_server_url(self):
     """Create the URL to communicate with the Kofa server.
     """
     netloc = self.config.get('Server', 'waeup_url')
     return get_url(netloc, self.waeup_username, self.waeup_password)
예제 #5
0
 def test_get_url_no_scheme(self):
     # we get HTTPS if no scheme was specified
     assert get_url(
         'localhost:8080', 'bob', 'secret'
         ) == "https://*****:*****@localhost:8080"
예제 #6
0
 def test_get_url_no_port(self):
     # we can construct valid URLs w/o port.
     assert get_url(
         'https://localhost', 'bob', 'secret'
         ) == "https://*****:*****@localhost"
예제 #7
0
 def test_get_url(self):
     # we can get completed urls from netlocations plus credentials
     assert get_url(
         'http://*****:*****@localhost:8080"
예제 #8
0
 def test_get_url_paths(self):
     # paths are kept in URLs
     assert get_url('https://*****:*****@localhost:8080/app"
예제 #9
0
 def test_get_url_no_port(self):
     # we can construct valid URLs w/o port.
     assert get_url('https://localhost', 'bob',
                    'secret') == "https://*****:*****@localhost"
예제 #10
0
 def test_get_url_no_scheme(self):
     # we get HTTPS if no scheme was specified
     assert get_url('localhost:8080', 'bob',
                    'secret') == "https://*****:*****@localhost:8080"
예제 #11
0
 def test_get_url(self):
     # we can get completed urls from netlocations plus credentials
     assert get_url('http://*****:*****@localhost:8080"