diff options
| author | Doug Hellmann <doug.hellmann@dreamhost.com> | 2012-05-02 17:02:08 -0400 |
|---|---|---|
| committer | Doug Hellmann <doug.hellmann@dreamhost.com> | 2012-05-04 09:35:40 -0400 |
| commit | 5e4032150d360a305397e0220e51c5a66f2f5313 (patch) | |
| tree | 77ca626617774880f4eda5fa3143f0c9add642e3 /tests | |
| parent | b5a809d8e39e856a4b5e60383f5f35065a48fd12 (diff) | |
| download | python-openstackclient-5e4032150d360a305397e0220e51c5a66f2f5313.tar.gz | |
Fix "help" command and implement "list server" and "show server"
blueprint client-manager
blueprint nova-client
bug 992841
Move the authentication logic into a new ClientManager class so that only commands that need to authenticate will trigger that code.
Implement "list server" and "show server" commands as examples of using the ClientManager, Lister, and ShowOne classes.
Change-Id: I9845b70b33bae4b193dbe41871bf0ca8e286a727
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_clientmanager_clientcache.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_clientmanager_clientcache.py b/tests/test_clientmanager_clientcache.py new file mode 100644 index 00000000..200da01f --- /dev/null +++ b/tests/test_clientmanager_clientcache.py @@ -0,0 +1,22 @@ + +from openstackclient.common import clientmanager + + +def factory(inst): + return object() + + +class Container(object): + + attr = clientmanager.ClientCache(factory) + + def init_token(self): + return + + +def test_singleton(): + # Verify that the ClientCache descriptor only + # invokes the factory one time and always + # returns the same value after that. + c = Container() + assert c.attr is c.attr |
