diff options
| author | Tang Chen <tangchen@cn.fujitsu.com> | 2015-11-21 13:33:20 +0800 |
|---|---|---|
| committer | Tang Chen <tangchen@cn.fujitsu.com> | 2015-11-21 13:33:20 +0800 |
| commit | 815cd8a1991b88511e6a6afca926a3c104e9e7a8 (patch) | |
| tree | c1f9409e18f6cd475c9e0766f592c64352b39ada /openstackclient/common | |
| parent | 65e6c7bc63d1a2137ae454f792b17feba7fab9b8 (diff) | |
| download | python-openstackclient-815cd8a1991b88511e6a6afca926a3c104e9e7a8.tar.gz | |
Use class FakeServer in TestServerCreate.
In the current TestServerCreate, there are several problems:
1. The fake create() returns a server with no 'networks' field.
The new_server is used to fake the created server which is
supposed to be returned by create(), but it has a 'networks'
field.
They have the same name and id, but they are actually not
the same server.
As a result, when checking the return value from create(),
'networks' is not checked.
2. The fake server is not accessable in the test functions.
So each time a test function wants to get the server name
or id, it has to use the constants defined in compute_fakes.
This is not good. We should make the fake server accessable
in all test functions to ensure they actually get the same
server.
This patch fix them both by using the new class FakeServer to
fake a server.
Change-Id: I8ffc8e233f8710034329ed33fccb2c734898ec2d
Implements: blueprint osc-unit-test-framework-improvement
Diffstat (limited to 'openstackclient/common')
0 files changed, 0 insertions, 0 deletions
