Commit Graph

10 Commits

Author SHA1 Message Date
Hervé Beraud 4b654a840f Use unittest.mock instead of mock
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.

Change-Id: I7b97fab683e45118327b93c776f8c487feab7374
2020-06-11 17:06:19 +02:00
Zhao Chao 1667ad5e80 Allow host URL for versions to be configurable
The versions resource constructs the links by using application_url,
but it's possible that the API endpoint is behind a load balancer
or SSL terminator. This means that the application_url might be
incorrect. This fix provides a config option (similar to other
services) which lets us  override the host URL when constructing
links for the versions API.

Co-Authored-By: Nikhil Manchanda <SlickNik@gmail.com>
Change-Id: I23f06c6c2d52ba46c74e0d097c4963d2de731d30
Closes-bug: 1384379
2018-02-07 11:31:45 +08:00
jiansong c19fa87ff7 To simplify the setUp
At the time of test setup, repeat the definition of the several
variables, and does not change the contents of the variable in a
method, they can be declared as global variables to the to simplify
the setup

Close-Bug: #1621464
Change-Id: I9c00c17e85c591671e0a104c004d6465b7bbb72a
2016-09-08 05:53:44 -07:00
Gábor Antal 826457dd29 Use assertEqual instead of assertTrue
In some cases, assertTrue(observed == expected) was used
instead of assertEqual(expected, observed), which is a
better way to test equality

Change-Id: I1b966e93f3a992b2e04f9e52242ba154367da25c
2016-02-29 13:49:47 +01:00
Sushil Kumar 843bb0cd53 Fixes hacking rules
This patchset helps reducing the ignored pep8 errors.

Fixed some ignored hacking rules, as listed follows:
- E111 indentation is not a multiple of four
- E122 continuation line missing indentation or outdented
- E123 closing bracket does not match indentation of opening bracket's line
- E128 continuation line under-indented for visual indent
- E251 unexpected spaces around keyword / parameter equals
- E265 block comment should start with '# '
- E713 test for membership should be 'not in'
- H105  Don't use author tags
- H306  imports not in alphabetical order

Change-Id: Iadf2af4f6ec90420153ad63b5a41650392ef2cbd
2015-05-29 07:27:59 +00:00
Petr Malik 8fa76ceff8 Update modules to turn on dangling mock detection
Make all test suites in the api, configuration, instance, network,
mysql, router, quota, db, and datastore modules extend
'trove_testtools.TestCase' to enable dangling mock detection.

Co-Authored-By: Peter Stachowski <peter@tesora.com>
Change-Id: If9326709d76972d66fb40b4984bbb5214b0c5189
Partial-Bug: 1448273
2015-05-12 18:56:28 -04:00
Michael Basnight 88e599f597 Removes XML api from trove
The XML api is no longer a requirement, as dictated by the TC.

implements blueprint destroy-xml-api

Change-Id: Ib4669155c19562ae1dda75cd30ad1a8f92b6be6a
2014-03-10 00:16:49 +00:00
He Yongli 52db0a385a Remove extraneous vim configuration comments
Remove vim setting, Remove line containing:
comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4

at the top of source code files, except for files in
openstack/common.

Change-Id: I5e2aad6dca8407890fc3c2afbda541bd4f124ea8
Closes-Bug: #1229324
2014-02-27 15:05:21 +08:00
Sushil Kumar 5aaac4c6fa Removes unused import statements
Updates tox.ini to remove suppressed F401 standard.

Updates the code files containing unused import statements

Change-Id: Ib44bd1509fdb17f457a205f9e62caf85cebee830
Closes-Bug: #1257267
2013-12-03 19:22:40 +00:00
Michael Basnight 7ab80b554d Rename from reddwarf to trove.
Implements Blueprint reddwarf-trove-rename

Change-Id: Ia9ee609bbc06a1d8b9d6917642529f30347541fd
2013-06-24 14:11:15 -07:00