~doanac/ubuntu-ci-services-itself/upgrade-support

« back to all changes in this revision

Viewing changes to ci-utils/ci_utils/image_store/tests/test-image-store.py

  • Committer: Chris Johnston
  • Author(s): Evan Dandrea
  • Date: 2014-03-17 06:33:02 UTC
  • mfrom: (400.1.10 time-sorted-tests)
  • Revision ID: chris_johnston-20140317063302-52wct68d41e6qubs
[r=Andy Doan, Chris Johnston, PS Jenkins bot] Shave two minutes off test execution. Add a small program to print sorted test execution time.  from Evan Dandrea

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
16
 
17
17
from ci_utils.image_store import ImageStore, ImageStoreException
 
18
from keystoneclient.exceptions import AuthorizationFailure
18
19
import unittest
 
20
import mock
19
21
 
20
22
 
21
23
class TestImageStore(unittest.TestCase):
22
 
    def test_bad_auth(self):
 
24
    # Do not attempt to talk to a keystone server.
 
25
    @mock.patch('keystoneclient.httpclient.HTTPClient.authenticate',
 
26
                side_effect=AuthorizationFailure())
 
27
    def test_bad_auth(self, *args):
23
28
        auth_data = {
24
29
            'auth_url': 'https://keystone.canonistack.canonical.com:443/v2.0/',
25
30
            'auth_user': 'bad data',