def get(self): prefixes = sorted(package_api.list_package_names(config.bucket)) context = {'prefixes': prefixes} logging.info('Matching prefixes: %s', prefixes) template = JINJA_ENVIRONMENT.get_template('simple.html') self.response.write(template.render(**context))
def test_returns_list_of_filenames(self): with mock.patch('cloudstorage.listbucket') as list_method: list_method.return_value = [MockCloudstorageFile(_file[0]) for _file in test_files] files = list_package_names('packages', ) for _file in test_files: self.assertTrue(_file[1] in files)
def test_returns_list_of_filenames(self): with mock.patch('cloudstorage.listbucket') as list_method: list_method.return_value = [ MockCloudstorageFile(_file[0]) for _file in test_files ] files = list_package_names('packages', ) for _file in test_files: self.assertTrue(_file[1] in files)