~ubuntu-branches/ubuntu/trusty/heat/trusty-security

« back to all changes in this revision

Viewing changes to heat/tests/test_cli.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Yolanda Robla, Chuck Short
  • Date: 2013-07-22 16:22:29 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130722162229-zzvfu40id94ii0hc
Tags: 2013.2~b2-0ubuntu1
[ Yolanda Robla ]
* debian/tests: added autopkg tests

[ Chuck Short ]
* New upstream release
* debian/control:
  - Add python-pbr to build-depends.
  - Add python-d2to to build-depends.
  - Dropped python-argparse.
  - Add python-six to build-depends.
  - Dropped python-sendfile.
  - Dropped python-nose.
  - Added testrepository.
  - Added python-testtools.
* debian/rules: Run testrepository instead of nosetets.
* debian/patches/removes-lxml-version-limitation-from-pip-requires.patch: Dropped
  no longer needed.
* debian/patches/fix-package-version-detection-when-building-doc.patch: Dropped
  no longer needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#    under the License.
14
14
 
15
15
 
16
 
from nose.plugins.attrib import attr
17
 
import unittest
 
16
import testtools
18
17
import heat
19
18
import os
20
19
import subprocess
22
21
basepath = os.path.join(heat.__path__[0], os.path.pardir)
23
22
 
24
23
 
25
 
@attr(tag=['unit', 'cli'])
26
 
@attr(speed='medium')
27
 
class CliTest(unittest.TestCase):
28
 
 
29
 
    def test_bins(self):
30
 
        bins = ['heat-cfn', 'heat-boto', 'heat-watch']
31
 
 
32
 
        for bin in bins:
 
24
class CliTest(testtools.TestCase):
 
25
 
 
26
    def test_heat_cfn(self):
 
27
            self.bin_run('heat-cfn')
 
28
 
 
29
    def test_heat_boto(self):
 
30
            self.bin_run('heat-boto')
 
31
 
 
32
    def test_heat_watch(self):
 
33
            self.bin_run('heat-watch')
 
34
 
 
35
    def bin_run(self, bin):
33
36
            fullpath = basepath + '/bin/' + bin
34
37
 
35
38
            proc = subprocess.Popen(fullpath,
38
41
            stdout, stderr = proc.communicate()
39
42
 
40
43
            if proc.returncode:
41
 
                print 'Error executing %s:\n %s %s ' % (bin, stdout, stderr)
 
44
                print('Error executing %s:\n %s %s ' % (bin, stdout, stderr))
42
45
                raise subprocess.CalledProcessError(proc.returncode, bin)