[PATCH 6 of 6] blackbox: tests for the blackbox extension
Brodie Rao
brodie at sf.io
Sun Feb 10 06:24:40 CST 2013
On Sun, Feb 10, 2013 at 11:07 AM, Durham Goode <durham at fb.com> wrote:
> # 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)
I think it's a little confusing that the date is completely globbed
out here. Can you make the date stable and add it to the test?
> +
> +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 ..
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list