Skip to content

Commit

Permalink
Add basic tests for new sparse sub-commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-blanchard committed Jun 16, 2015
1 parent 343f9c9 commit b05bfc1
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/streamparse/cli/test_jar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from __future__ import absolute_import, unicode_literals

import argparse
import unittest

from streamparse.cli.jar import subparser_hook

from nose.tools import ok_


class JARTestCase(unittest.TestCase):

def test_subparser_hook(self):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

subcommands = parser._optionals._actions[1].choices.keys()
ok_('jar' in subcommands)


if __name__ == '__main__':
unittest.main()
23 changes: 23 additions & 0 deletions test/streamparse/cli/test_remove_logs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from __future__ import absolute_import, unicode_literals

import argparse
import unittest

from streamparse.cli.remove_logs import subparser_hook

from nose.tools import ok_


class RemoveLogsTestCase(unittest.TestCase):

def test_subparser_hook(self):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

subcommands = parser._optionals._actions[1].choices.keys()
ok_('remove_logs' in subcommands)


if __name__ == '__main__':
unittest.main()
23 changes: 23 additions & 0 deletions test/streamparse/cli/test_update_virtualenv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from __future__ import absolute_import, unicode_literals

import argparse
import unittest

from streamparse.cli.update_virtualenv import subparser_hook

from nose.tools import ok_


class UpdateVirtualenvTestCase(unittest.TestCase):

def test_subparser_hook(self):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

subcommands = parser._optionals._actions[1].choices.keys()
ok_('update_virtualenv' in subcommands)


if __name__ == '__main__':
unittest.main()

0 comments on commit b05bfc1

Please sign in to comment.