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)
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)
def test_get_url_paths(self): # paths are kept in URLs assert get_url( 'https://*****:*****@localhost:8080/app"
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)
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"
def test_get_url_no_port(self): # we can construct valid URLs w/o port. assert get_url( 'https://localhost', 'bob', 'secret' ) == "https://*****:*****@localhost"
def test_get_url(self): # we can get completed urls from netlocations plus credentials assert get_url( 'http://*****:*****@localhost:8080"
def test_get_url_paths(self): # paths are kept in URLs assert get_url('https://*****:*****@localhost:8080/app"
def test_get_url_no_port(self): # we can construct valid URLs w/o port. assert get_url('https://localhost', 'bob', 'secret') == "https://*****:*****@localhost"
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"
def test_get_url(self): # we can get completed urls from netlocations plus credentials assert get_url('http://*****:*****@localhost:8080"