[Pkg-bazaar-commits] ./bzr/unstable r300: - more tests
Martin Pool
mbp at sourcefrog.net
Fri Apr 10 07:43:51 UTC 2009
------------------------------------------------------------
revno: 300
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Thu 2005-04-28 19:15:31 +1000
message:
- more tests
modified:
testbzr
-------------- next part --------------
=== modified file 'testbzr'
--- a/testbzr 2005-04-28 09:07:38 +0000
+++ b/testbzr 2005-04-28 09:15:31 +0000
@@ -40,7 +40,7 @@
def runcmd(cmd, retcode=0):
- """run one command and check the output.
+ """Run one command and check the return code.
If a single string is based, it is split into words.
For commands that are not simple space-separated words, please
@@ -69,6 +69,7 @@
os.chdir(dirname)
+
def log_linenumber():
"""Log the stack frame location two things up."""
stack = traceback.extract_stack()[-3]
@@ -85,24 +86,37 @@
logfile = open('testbzr.log', 'wt', buffering=1)
-try:
- os.mkdir(TESTDIR)
+try:
+ runcmd(['mkdir', TESTDIR])
cd(TESTDIR)
- progress("testing introductory commands")
+ progress("introductory commands")
runcmd("bzr version")
runcmd("bzr help")
runcmd("bzr --help")
- progress("testing user identity")
+ progress("user identity")
# this should always identify something, if only "john at localhost"
runcmd("bzr whoami")
runcmd("bzr whoami --email")
- progress("testing invalid commands")
+ progress("invalid commands")
runcmd("bzr pants", retcode=1)
runcmd("bzr --pants off", retcode=1)
+ progress("basic branch creation")
+ runcmd(['mkdir', 'branch1'])
+ cd('branch1')
+ runcmd('bzr init')
+
+ f = file('test.txt', 'wt')
+ f.write('hello world!\n')
+ f.close()
+
+
+
+ cd('..')
+
progress("all tests passed!")
except Exception, e:
sys.stderr.write('*' * 50 + '\n'
@@ -112,3 +126,4 @@
logfile.write('tests failed!\n')
traceback.print_exc(None, logfile)
sys.exit(1)
+
More information about the Pkg-bazaar-commits
mailing list