summaryrefslogtreecommitdiff
path: root/ceilometerclient/tests/v2/test_options.py
Commit message (Collapse)AuthorAgeFilesLines
* Move unit tests into their own subdirectoryChris Dent2015-03-131-239/+0
| | | | | | | | | | | | | | This is in preparation of moving functional tests currently in tempest in-tree. No surprises in this change: * move files * update the local imports Same number of tests run, all still pass. Change-Id: Ibfeac44421c5f36740b1377868f5ec469b2893f5
* Use HTTPClient from common Oslo codeekudryashova2014-07-311-1/+0
| | | | | | | | | In the process of unification of the clients code we should reuse common functionality from Oslo. bp common-client-library-2 Change-Id: I0e027c33ee42b6de032d33269caeea33e7837f40
* Refactor split_by_op and split_by_datatypeChris Dent2014-06-021-3/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | split_by_op was returning data against which further error checking was then required. This change moves that error handling inside the method and simplifies the regular expression so that it splits (greedily) on the first operator it finds. If the split is not possible, it is a ValueError. If the field or value are empty, that is a ValueError. Both split_by_op and split_by_datatype were doing a findall() where a match() and split() do the right job and more efficiently. Regular expression compilation has been moved to the module level to insure they need only be compiled once. Operator keys must be sorted by length to ensure the point at which the split happens is most greedy. Using a split keeps the regex short and removes any statements about the left and right hand sides of the operator. Tests added to cover the method more completely, including testing for corner cases such as single character field or values or operators showing up in unexpected locations. 'string' variable renamed to 'query' and 'query_value' to avoid confusion. Named parameters on string substitution for clarity. Note that the tests which do self.assertRaises could more explicitly check the exception with self.assertRaisesRegexp but that would break compatibility with Python 2.6. Change-Id: Icd815ff65aba9eae3f76afee3bb33e85d85bea72 Closes-Bug: #1314544
* Support the Event APIJohn Herndon2014-01-101-9/+79
| | | | | | | | | | | | This patch adds support for the currently available Event API, including events, event types, and traits. Add an optional data type to the query, ex: ceilometer list-events -q 'hostname=string::localhost" bp extend-client-operations Change-Id: Icea9bd67f8ee4ff2bf9da9ff6894218689580eb3
* align the order of parameters for urlencode()Kui Shi2013-10-151-3/+3
| | | | | | | | | | | | | | | | | In Python 3.3, hash randomization is enabled by default. It causes the iteration order of dicts and sets to be unpredictable and differ across Python runs. In the test case, the fixed expecting string will not match the test result, it is relying on the dict order. This change transforms the input dict to a sequence of two-element list, with fixed order, and update the related expecitng string / fixture in test cases. Partial Implement: blueprint py33-support Change-Id: I6dccde9e584be8335a6375f5fbad5c5cbd7b9b6d
* Enhance ceilometer statistics command with --periodGuangyu Suo2013-07-231-0/+9
| | | | | | | | | Currently, if don't specify query parameter in ceilometer statistics command, ceilometer statistics with --period will not work. This change is trying to fix this issue. Change-Id: I8723bad11d5c452c2834e33df9bb01ebdc6ce9ce Fixs: bug #1202658
* Move tests to ceilometerclient.Monty Taylor2013-06-301-0/+75
tests.* implies an incorrect global package name. Additionally, consuming code can benefit from being able to choose to consume test code and fixtures. Change-Id: I7ba2b3ba1c2a99410b54fc40b48dfe2fc53eb79a