Ejemplo n.º 1
0
    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))
Ejemplo n.º 2
0
    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))
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
    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)