aboutsummaryrefslogtreecommitdiffstats
path: root/becommands/set_root.py
diff options
context:
space:
mode:
authorAaron Bentley <abentley@panoramicfeedback.com>2005-05-18 20:09:53 +0000
committerAaron Bentley <abentley@panoramicfeedback.com>2005-05-18 20:09:53 +0000
commit4910cf78aee314c76c62b7cba19ab36456545e4e (patch)
tree966362534cfc913d7d55e98b84c3271a2c9ac50d /becommands/set_root.py
parent35cb1d08a50bed019f86ef3a81140549475b9045 (diff)
downloadbugseverywhere-4910cf78aee314c76c62b7cba19ab36456545e4e.tar.gz
Added tests for double-init
Diffstat (limited to 'becommands/set_root.py')
-rw-r--r--becommands/set_root.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/becommands/set_root.py b/becommands/set_root.py
index c83fd1a..df60721 100644
--- a/becommands/set_root.py
+++ b/becommands/set_root.py
@@ -34,13 +34,19 @@ def execute(args):
>>> bd.root = dir.name
>>> dir = tests.arch_dir()
>>> os.chdir(dir.name)
- >>> execute('.')
+ >>> execute(['.'])
Using Arch for revision control.
Directory initialized.
>>> bd = bugdir.tree_root(dir.name+"/{arch}")
>>> bd.root = dir.name
+ >>> try:
+ ... execute(['.'])
+ ... except cmdutil.UserError, e:
+ ... str(e).startswith("Directory already initialized ")
+ Using Arch for revision control.
+ True
>>> tests.clean_up()
- >>> execute(('/highly-unlikely-to-exist',))
+ >>> execute(['/highly-unlikely-to-exist'])
Traceback (most recent call last):
UserError: No such directory: /highly-unlikely-to-exist
"""
@@ -56,6 +62,8 @@ def execute(args):
bugdir.create_bug_dir(args[0], dir_rcs)
except bugdir.NoRootEntry:
raise cmdutil.UserError("No such directory: %s" % args[0])
+ except bugdir.AlreadyInitialized:
+ raise cmdutil.UserError("Directory already initialized: %s" % args[0])
print "Directory initialized."
def get_parser():