summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2013-06-26 17:15:19 +0200
committerGuido Günther <agx@sigxcpu.org>2013-06-26 18:18:32 +0200
commita5aff11ba22a5b2f2c56d3325f431d51681e6c9b (patch)
tree3417d73fb0eddf7aa64591ed0b0e2b4873ef4673 /tests
parent375014db7fa3981b1b0e071013fb365a3840b32d (diff)
Consistently call gbp the supercommand
and robustify against invalid modules names.
Diffstat (limited to 'tests')
-rw-r--r--tests/16_test_supercommand.py (renamed from tests/16_test_wrapper.py)21
1 files changed, 17 insertions, 4 deletions
diff --git a/tests/16_test_wrapper.py b/tests/16_test_supercommand.py
index 35f50bc..5a9f037 100644
--- a/tests/16_test_wrapper.py
+++ b/tests/16_test_supercommand.py
@@ -16,14 +16,27 @@
"""Test L{gbp} command wrapper"""
import unittest
-import gbp.scripts.command
+import gbp.scripts.supercommand
-class TestWrapper(unittest.TestCase):
+class TestSuperCommand(unittest.TestCase):
+
+ def test_import(self):
+ self.assertRaises(ImportError,
+ gbp.scripts.supercommand.import_command,
+ 'not.allowed')
+ self.assertRaises(ImportError,
+ gbp.scripts.supercommand.import_command,
+ 'not/allowed')
+ self.assertRaises(ImportError,
+ gbp.scripts.supercommand.import_command,
+ '0notallowed')
def test_invalid_command(self):
"""Test if we can import a valid command"""
- self.assertEqual(gbp.scripts.command.gbp_command(['argv0', 'asdf']), 2)
+ self.assertEqual(gbp.scripts.supercommand.supercommand(
+ ['argv0', 'asdf']), 2)
def test_missing_arg(self):
- self.assertEqual(gbp.scripts.command.gbp_command(['argv0']), 1)
+ self.assertEqual(gbp.scripts.supercommand.supercommand(
+ ['argv0']), 1)