add a test for the new --version CLI

This commit is contained in:
Martin A. Brown 2016-05-16 09:38:09 -07:00
parent 9f5b7c2ded
commit beb920dd58
1 changed files with 18 additions and 0 deletions

View File

@ -12,6 +12,7 @@ import uuid
import errno
import codecs
import random
import unittest
from tempfile import NamedTemporaryFile as ntf
from argparse import Namespace
@ -20,6 +21,7 @@ from tldp.typeguesser import knowndoctypes
from tldp.inventory import stypes, status_types
from tldp.sources import SourceDocument
from tldp.outputs import OutputDirectory
from tldp import VERSION
# -- Test Data
import example
@ -127,6 +129,22 @@ class TestDriverShowStatustypes(TestToolsFilesystem):
self.assertEqual(exitcode, os.EX_OK)
class TestDriverShowVersion(unittest.TestCase):
def test_show_version(self):
stdout = io.StringIO()
result = tldp.driver.show_version(Namespace(), file=stdout)
self.assertEqual(result, os.EX_OK)
data =
for status in status_types:
self.assertEqual(VERSION, data)
def test_run_statustypes(self):
exitcode =['--version'])
self.assertEqual(exitcode, os.EX_OK)
class TestDriverSummary(TestInventoryBase):
def test_run_summary(self):