summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Ensure v1 'limit' query parameter works correctly.0.4.2Brian Lamar2012-08-151-2/+3
| | | | | | | | | | | The tests were present but were not asserting list results. page_size was overriding the absolute limit so limits were not working if they were less than the page_size. Fixes bug 1037233 Change-Id: If102824212e3846bc65d3f7928cf7aa2e48aaa63
* Allow 'deleted' to be passed through image update0.4.1Brian Waldon2012-08-131-0/+2
| | | | | | | | | | The legacy client allowed users to pass 'deleted' through an update call. This is breaking some clients of this library because they expect to be be able to still do that. Fixes bug 1036315 Change-Id: I9ae20a5e4579240c7d5e86316d6d1e927755dbf5
* Cast is_public, protected, deleted to boolBrian Waldon2012-08-131-0/+14
| | | | | | | | | To keep a consistent view of an image, is_public, protected, and deleted need to be cast to a bool when being parsed from headers. Fix bug 1036299 Change-Id: I2730a0f2d705d26ebc0ba883e99c1caf44d70b51
* Return known int values as int, not strBrian Waldon2012-08-131-3/+6
| | | | | | | | | Cast size, min_ram, min_disk to integers before returning them to the user from the v1 API. Fixes bug 1036297 Change-Id: Ib1e2a3bf931e433b6311cc8a1a5219168b50be97
* Enable client V2 to download imagesLars Gellrich2012-08-094-2/+210
| | | | | | | | | | Added the CLI option image-download to download an image via API V2. Added utility function to save an image. Added common iterator to validate the checksum. Related to bp glance-client-v2 Change-Id: I0247f5a3462142dc5e9f3dc16cbe00c8e3d42f42
* Refactor HTTP-related exceptionsBrian Waldon2012-08-081-0/+29
| | | | | | | | | | | | | | | | | * Refactor helper function that builds the map of http status codes to local http exceptions - now we don't have to explicitly list every single exception name * Add several exceptions to represent http status codes that were not previously represented * Improve consistency of exceptions naming by prepending 'HTTP' to necessary exception names * Use HTTPException instead of ClientException * Deprecate old http exceptions (those that aren't prefixed with HTTP) * Deprecate ClientException * Deprecate unused NoTokenLookupException and EndpointNotFound * Add test module to spot-check the from_response helper Change-Id: Ibc7fef9e2a5b24bd001d183d377901f302d650a9
* Stop looking for v2 image in containerBrian Waldon2012-07-301-4/+2
| | | | | | | | | | The v2 API no longer returns images in JSON containers like '{"image": {...}}', so stop trying to decode the responses as if it does. Fix bug 1031185 Change-Id: I5209fe76445d4195b12944146a0ef190883f363f
* Replace httplib2 with httplib as http driverBrian Waldon2012-07-231-2/+18
| | | | | | | | * This allows us to send truly chunked responses to users * Handle bad connection url schemes with a new InvalidEndpoint exception * Fixes bug 1023240 Change-Id: I34500987f51d4e0c6e1f89ecf93853de3fcbb1c3
* Add pagination to v1 image-listBrian Waldon2012-07-193-22/+108
| | | | | | | | | | | | | | | | * Use recursive generator function to make subsequent requests to the v1 detailed images resource * 'limit' continues to act as the absolute limit of images to return from a list call * 'page_size' indicates how many images to ask for in each subsequent pagination request * Expose --page-size through the cli * Convert v1 images tests to use strict url comparison * Drop strict_url_check from FakeAPI kwargs - now the functionality is always active and tests must directly match fixture urls * Fix bug 1024614 Change-Id: Ifa7874d88360e03b5c8aa95bfb9d5e6dc6dc927e
* Merge "Wrap image data in iterator"Jenkins2012-07-191-2/+2
|\
| * Wrap image data in iteratorBrian Waldon2012-07-111-2/+2
| | | | | | | | | | | | | | | | | | | | This is establishing the API for a future optimization. We want to be able to offer true socket-level caching, but can't do that with httplib2 right now. For now, we will just fake the optimization by returning an iterator over the image body, which happens to already be fully loaded into a string. Change-Id: I2d36e3cdd45b26d7c7c27ba050bf6a4b5765df6c
* | Add pagination to v2 image-listBrian Waldon2012-07-132-5/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use a recursive generator function to iterate over the image container. The presence of next links are indicators to continue pagination while their value drives the location of the next page. * A user can pass in --page-size on the command line, or page_size when using the controller directly, to control how many images are requested with each subsequent paginated request. Default page size is 20. * Add a flag (strict_url_check) for the FakeAPI class to control whether it chops off query params when trying to match a request to a fixture. * Related to bp glance-client-v2. Change-Id: Ib98e912a7af0bb570b4fd738733edd9b837d1a12
* | Convert v2 images list method to generatorBrian Waldon2012-07-131-1/+2
| | | | | | | | | | | | | | | | | | We will want this to be a generator as soon as we implement pagination. Let's establish the interface now. Related to bp glance-client-v2 Change-Id: Ib98e912a7af0bb570b4fd738733edd9b837d1a07
* | Replace static v2 Image model with warlock modelBrian Waldon2012-07-132-10/+10
| | | | | | | | | | | | | | | | | | * Add warlock v0.1.0 as a dependency * Generate a pythonic, self-validating Image model using warlock * Add raw method to Schema model * Related to bp glance-client-v2 Change-Id: Ib98e912a7af0bb570b4fd738733edd9b837d1a04
* | Add support for viewing a single image through v2Brian Waldon2012-07-131-0/+79
| | | | | | | | | | | | | | | | * Add image-create command * Add tests for Image model, Controller.get, and Controller.list * Related to bp glance-client-v2 Change-Id: Ib98e912a7af0bb570b4fd738733edd9b837d1a06
* | Rewrite link parsing for finding v2 schemasBrian Waldon2012-07-131-4/+4
|/ | | | | | | | | | | | | | | | What we called 'links' are no longer returned in a container of objects, they are top-level entity attribtues. This fixes the parsing of the entities to look in the correct place when trying to locate a specific schema. Add a helper for printing to stderr and exiting with a non-zero exit code. Map 'name' to 'Attribute' when explaining a schema. Related to bp glance-client-v2 Change-Id: Ib98e912a7af0bb570b4fd738733edd9b837d1a05
* Preserve image properties on updateBrian Waldon2012-07-091-0/+6
| | | | | | | | | | * By default, image properties should not be deleted on image update. * A user can specify --purge-props through the CLI or purge_props as a keyword argument to ImageManager.update to override the default behavior and force properties to be deleted. * Fixes bug 1022758 Change-Id: Ib079378cb765552fc29a66913aefbbcd934d2065
* Allow image filtering by custom propertiesBrian Waldon2012-07-041-0/+5
| | | | | | | | | | | A user can filter a list of images by passing in a 'properties' sub-dictionary inside of the 'filters' keyword argumen to ImageManager.list(). The same functionality can be used through the CLI through the use of one or more'--property-filter' options. Related to bp glance-client-parity. Change-Id: I7d119174d83faa894dde557e1944289de296a02c
* Hook up GET /v1/images/<id>Brian Waldon2012-06-211-0/+20
| | | | | | | This allows us to get raw image data out of the API! Related to bp glance-client-parity Change-Id: Id5f55553d2ff3b7bf58515062afdfd4b9b183a54
* Add 'explain' command to v2 that describes schemasBrian Waldon2012-06-076-133/+243
| | | | | | | | | At its core, this is adding the ability to finx a schema through published links and convert it to a usable object. Related to bp glance-client-v2 Change-Id: I7b38ad091c6b0ad80197eb789503cf73989893e5
* Auto generate AUTHORS file for glanceclient component.Bhuvan Arumugam2012-06-021-63/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 976267 Now that git commits are gated by CLA, we shouldn't enforce committers to add an entry in AUTHORS file. The AUTHORS file should be generated automatically, based on git commits. This commit fixes the problem. * AUTHORS Remove this file. * .gitignore Add AUTHORS file. * glanceclient/openstack/common/setup.py Sync changes from openstack-common. * setup.py Generate AUTHORS file before creating the package. * glanceclient/shell.py Pep8 fix. * tests/test_authors.py Remove this test case. Change-Id: I9e9d4da5ca3b147b483250dcf25a3b2a840123c2
* Refactor HTTPClient to use two request methodsBrian Waldon2012-05-221-35/+34
| | | | | | | | | Rather than depend on magic, I would prefer that we explicitly call two different request methods: json_request and raw_request. The former will encode/decode request bodies to and from JSON, while the latter will not. Change-Id: I6a429a5975993f71df85df55f11c5d51c050c289
* Adds filter support to images.list().Gabriel Hurley2012-04-271-0/+5
| | | | | | | This existed in glance.client, and should exist in the new client as well! :-) Change-Id: Iea8c55fcb0f0d30d6dc138072354c3f20d1288cf
* Add AUTHORS test caseBrian Waldon2012-04-031-0/+63
| | | | Change-Id: Ib81aee90fef3b2c101bb6b737e677339638b3cad
* Adding id for image membersBrian Waldon2012-04-031-7/+5
|
* image membership management worksBrian Waldon2012-04-032-12/+8
|
* Adding support for passing image data through cliBrian Waldon2012-04-031-1/+9
|
* Image update worksBrian Waldon2012-04-032-10/+45
|
* More complete image creationBrian Waldon2012-04-032-7/+47
|
* Adding shared-images supportBrian Waldon2012-04-022-4/+41
|
* Image members bonesBrian Waldon2012-04-023-2/+113
|
* Basic testingBrian Waldon2012-04-025-5/+129
|
* Basic get/list operations workBrian Waldon2012-03-261-0/+5
* 'glance image-list' and 'glance image-show' work * Set up tests, pep8, venv