Commit Graph

11 Commits

Author SHA1 Message Date
Erno Kuvaja 3dde3204d5 Remove Images API v1 entry points
This change removes option to configure Images API v1
This change removes Images API v1 endpoints from the router
This change removes all v1 tests
This change removes the v1 dependant glance-cache-manage command

This change does not remove all v1 codebase. Further cleanup and
decoupling will be needed.

Change-Id: Ia086230cc8c92f7b7dfd5b001923110d5bc55d4d
2018-07-13 10:21:49 +01:00
Sean McGinnis 1c13d8a232 Remove use of deprecated optparse module
The optparse module has been deprecated for some time and all apps
should be updated to use argparse instead. This switches our one
remaining command that was using it to the newer argparse usage.

Change-Id: I8f801fb804515ecf2a8b402b2923135379730098
Closes-bug: #1553030
2017-10-01 07:08:00 -05:00
Gábor Antal 53379a714d Use more specific asserts in unit tests
In many places, there are more specific asserts
which can be used. I replaced the generic assert
with more specific ones, where it was possible.

This change enhances readibility, and on fail, more useful
message is displayed

Change-Id: I76dca80b6bd8886860fb383ee8d35e16cd99762e
2016-08-04 21:17:52 +02:00
Julien Danjou d8afed9c46 utils: remove PrettyTable custom class in favor of the eponym libary
Change-Id: Ic981f4d6085dcddbfce23c988fc145058a0f4b43
2016-01-26 10:18:04 +01:00
wangxiyuan 5d9814d38c Fix help command in cache manange and replicator
Now, 'glance-cache-manage help' and 'glance-replicator help' don't
work. They returned wrong result. It is not user friendly at all.

Closes-bug: #1533927
Change-Id: I9b5ff7eaff4b27a5e964231dd4dfbf02a3fac7db
2016-01-22 11:08:15 +08:00
Venkatesh Sampath 367925c770 Prevent extraneous log messages and stdout prints
while running unit tests using run_tests.sh,
we can see quite an amount of unwanted log
messages and stdout prints as part of
the unit test results on the console.
This basically makes it difficult to go
through the test results and figure whats happening.

This patch fixes the cause for those
extraneous log messages caused due to
a incorrect fixture usage in test_manage.py
and also by mocking sys.stdout at the respective unit tests.

Closes-bug: #1496898
Change-Id: If986691cb3f36ba357a5c0df34b6df7bf2d8ff86
2015-09-18 23:23:38 +05:30
Roman Vasilets cb2456ea5e Wrong order of assertEquals args(Glance)
Args of assertEquals method in glance.tests are arranged
in wrong order. In result when test fails it shows incorrect
information about observed and actual data. It's found more
than 2000 times. Right order of arguments is "expected, actual".

Change-Id: Ifea4809f5a696b608a19e36a9ed9e5eec46c8a21
Co-Authored-By: Li Yingjun <liyingjun1988@gmail.com>
Closes-Bug: 1277104
2014-11-13 17:10:09 +02:00
Julien Danjou fadbef8511 hacking: upgrade to 0.9.x serie
Change-Id: I252758fd633662de9659a402c5e3d7e3ce1fae0f
2014-10-06 14:41:03 +02:00
Sergey Nikitin 84dbe32a6d Replace assert* with more suitable asserts in unit tests
The following replacements were done in unit tests to have
clearer messages in case of failure:
- assertTrue(* is None) with assertIsNone
- assertTrue(* is not None) with assertIsNotNone
- assertTrue(* in *) with assertIn
- assertTrue(* not in *) with assertNotIn
- assertFalse(* in *) with assertNotIn
- assertTrue(* == *) with assertEqual
- assertTrue(* != *) with assertNotEqual

Change-Id: I0c47f991c3974e441335e71c9d26fab8a127f2ca
2014-04-17 10:35:46 +04:00
Dirk Mueller 40a70a97cf assertEquals is deprecated, use assertEqual instead
Change-Id: Ie67c4c84eb74d7ed27b3c6c253239aaa1aff4862
2013-12-11 22:18:20 +01:00
Vitaliy Kolosov 53fca479ea Unittests added for glance/cmd/cache_manage.py
Related to blueprint glance-cmd+unittests

Unittests for all methods, that manage cache added:
* list_cached
* list_queued
* queue_image
* delete_cached_image
* delete_all_cached_images
* delete_queued_image
* delete_all_queued_images

Unittests for several internal methods added:
catch_error; env; create_options; parse_options; lookup_command

Change-Id: Id07bbecdc9877268a514e3a594699364dcc4618f
2013-12-06 13:57:02 +02:00