[PATCH 6 of 6] blackbox: tests for the blackbox extension
Durham Goode
durham at fb.com
Sun Feb 10 05:07:22 CST 2013
# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1360445730 28800
# Node ID 932a1aea1b315a2b1c6e7dadfea803afd59b704e
# Parent 4192cc153d6f8d529723c9df20255693b73e723a
blackbox: tests for the blackbox extension
A few tests to cover the blackbox extension. Covers commands, hooks, and
incoming changes.
diff --git a/tests/test-blackbox.t b/tests/test-blackbox.t
new file mode 100644
--- /dev/null
+++ b/tests/test-blackbox.t
@@ -0,0 +1,54 @@
+setup
+
+ $ cat >> $HGRCPATH <<EOF
+ > [extensions]
+ > blackbox=
+ > EOF
+ $ hg init blackboxtest
+ $ cd blackboxtest
+
+command, exit codes, and duration
+
+ $ echo a > a
+ $ hg add a
+ $ hg blackbox
+ *> add a (glob)
+ *> add exited 0 after * seconds (glob)
+
+extension and python hooks - use the eol extension for a pythonhook
+
+ $ echo '[extensions]' >> .hg/hgrc
+ $ echo 'eol=' >> .hg/hgrc
+ $ echo '[hooks]' >> .hg/hgrc
+ $ echo 'update = echo hooked' >> .hg/hgrc
+ $ hg update
+ hooked
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg blackbox -l 4
+ *> update (glob)
+ *> pythonhook-preupdate: hgext.eol.preupdate finished in * seconds (glob)
+ *> exthook-update: echo hooked finished in * seconds (glob)
+ *> update exited False after * seconds (glob)
+
+incoming change tracking
+
+ $ hg clone . ../blackboxtest2
+ updating to branch default
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg commit -ma
+ $ cd ../blackboxtest2
+ $ hg pull
+ pulling from $TESTTMP/blackboxtest
+ requesting all changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 1 changes to 1 files
+ (run 'hg update' to get a working copy)
+ $ hg bb -l 3
+ *> pull (glob)
+ *> 1 incoming changes - new heads: cb9a9f314b8b (glob)
+ *> pull exited None after * seconds (glob)
+
+cleanup
+ $ cd ..
More information about the Mercurial-devel
mailing list