~ubuntu-branches/ubuntu/raring/nova/raring-proposed

« back to all changes in this revision

Viewing changes to nova/tests/api/openstack/compute/contrib/test_coverage_ext.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, James Page
  • Date: 2013-03-20 12:59:22 UTC
  • mfrom: (1.1.69)
  • Revision ID: package-import@ubuntu.com-20130320125922-ohvfav96lemn9wlz
Tags: 1:2013.1~rc1-0ubuntu1
[ Chuck Short ]
* New upstream release.
* debian/patches/avoid_setuptools_git_dependency.patch: Refreshed.
* debian/control: Clean up dependencies:
  - Dropped python-gflags no longer needed.
  - Dropped python-daemon no longer needed.
  - Dropped python-glance no longer needed.
  - Dropped python-lockfile no longer needed.
  - Dropped python-simplejson no longer needed.
  - Dropped python-tempita no longer needed.
  - Dropped python-xattr no longer needed.
  - Add sqlite3 required for the testsuite.

[ James Page ]
* d/watch: Update uversionmangle to deal with upstream versioning
  changes, remove tarballs.openstack.org. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
2
 
3
 
# Copyright 2012 IBM
 
3
# Copyright 2012 IBM Corp.
4
4
#
5
5
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
6
6
#    not use this file except in compliance with the License. You may obtain
34
34
    return False
35
35
 
36
36
 
37
 
def fake_xml_report(self, outfile):
38
 
    return
39
 
 
40
 
 
41
 
def fake_report(self, file):
42
 
    return
 
37
class FakeCoverage(object):
 
38
    def __init__(self, data_file=None):
 
39
        self.started = False
 
40
        return super(FakeCoverage, self).__init__()
 
41
 
 
42
    def save(self):
 
43
        pass
 
44
 
 
45
    def start(self):
 
46
        self.started = True
 
47
 
 
48
    def stop(self):
 
49
        if not self.started:
 
50
            raise AssertionError
 
51
        self.started = False
 
52
 
 
53
    def report(self, file):
 
54
        pass
 
55
 
 
56
    def xml_report(self, outfile):
 
57
        pass
43
58
 
44
59
 
45
60
class CoverageExtensionTest(test.TestCase):
48
63
        super(CoverageExtensionTest, self).setUp()
49
64
        self.stubs.Set(telnetlib.Telnet, 'write', fake_telnet)
50
65
        self.stubs.Set(telnetlib.Telnet, 'expect', fake_telnet)
51
 
        self.stubs.Set(coverage.coverage, 'report', fake_report)
52
 
        self.stubs.Set(coverage.coverage, 'xml_report', fake_xml_report)
 
66
        self.stubs.Set(coverage, 'coverage', FakeCoverage)
53
67
        self.admin_context = context.RequestContext('fakeadmin_0',
54
68
                                                    'fake',
55
69
                                                     is_admin=True)