Files
git-upstream/tests/test_commands.py
Davide Guerri f2e38df455 Rename hpgit to git-upstream, also changing its license
* rename hpgit to git-upstream
* rename import-upstream commadn to import
* change all occurrences of hpgit and import-upstream in code,
  comments and tests
* code cleanup (remove some typos, improve PEP8 compliance)
* change license from "HP propietary" to "Apache License v2.0"

Change-Id: Ia4f00d662d79ac9725316027a65f4d23ebbd0f02
JIRA:CICD-1319
JIRA:CICD-1318
2014-03-03 14:32:26 +00:00

32 lines
1.1 KiB
Python

#
# Copyright (c) 2012, 2013, 2014 Hewlett-Packard Development Company, L.P.
#
# Confidential computer software. Valid license from HP required for
# possession, use or copying. Consistent with FAR 12.211 and 12.212,
# Commercial Computer Software, Computer Software Documentation, and
# Technical Data for Commercial Items are licensed to the U.S. Government
# under vendor's standard commercial license.
#
"""Tests for the 'commands' module"""
import testtools
from argparse import ArgumentParser
from git_upstream import commands as c
class TestGetSubcommands(testtools.TestCase):
"""Test case for get_subcommands function"""
_available_subcommands = ('import', 'supersede' ,'drop')
def test_available_subcommands(self):
"""Test available subcommands"""
parser = ArgumentParser()
subparsers = parser.add_subparsers()
subcommands = c.get_subcommands(subparsers)
self.assertEqual(len(TestGetSubcommands._available_subcommands),
len(subcommands.keys()))
for command in subcommands.keys():
self.assertIn(command, TestGetSubcommands._available_subcommands)