-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest_misc.py
More file actions
41 lines (30 loc) · 1.35 KB
/
test_misc.py
File metadata and controls
41 lines (30 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
Unit tests for the Deis CLI auth commands.
Run these tests with "python -m unittest client.tests.test_misc"
or with "./manage.py test client.HelpTest client.VersionTest".
"""
from __future__ import unicode_literals
from unittest import TestCase
import pexpect
from client.deis import __version__
from .utils import DEIS
class HelpTest(TestCase):
"""Test that the client can document its own behavior."""
def test_deis(self):
"""Test that the `deis` command on its own returns usage."""
child = pexpect.spawn(DEIS)
child.expect('Usage: deis <command> \[<args>...\]')
def test_help(self):
"""Test that the client reports its help message."""
child = pexpect.spawn('{} --help'.format(DEIS))
child.expect('The Deis command-line client.*to an application\.')
child = pexpect.spawn('{} -h'.format(DEIS))
child.expect('The Deis command-line client.*to an application\.')
child = pexpect.spawn('{} help'.format(DEIS))
child.expect('The Deis command-line client.*to an application\.')
class VersionTest(TestCase):
"""Test that the client can report its version string."""
def test_version(self):
"""Test that the client reports its version string."""
child = pexpect.spawn('{} --version'.format(DEIS))
child.expect("Deis CLI {}".format(__version__))