tests: move mock blackbox extension into own file
authorGregory Szorc <gregory.szorc@gmail.com>
Mon, 13 Apr 2015 09:36:33 -0400
changeset 24705 0ead0a07ed9c
parent 24704 03f92741487f
child 24706 5150b2b5b345
tests: move mock blackbox extension into own file Having all blackbox log testing in test-blackbox.t isn't scalable. Move the mock blackbox extension into its own file so we can start to move blackbox logging into other tests.
tests/mockblackbox.py
tests/test-blackbox.t
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/mockblackbox.py	Mon Apr 13 09:36:33 2015 -0400
@@ -0,0 +1,11 @@
+from mercurial import util
+
+def makedate():
+    return 0, 0
+def getuser():
+    return 'bob'
+
+# mock the date and user apis so the output is always the same
+def uisetup(ui):
+    util.makedate = makedate
+    util.getuser = getuser
--- a/tests/test-blackbox.t	Sun Apr 12 14:59:31 2015 -0400
+++ b/tests/test-blackbox.t	Mon Apr 13 09:36:33 2015 -0400
@@ -1,20 +1,8 @@
 setup
-  $ cat > mock.py <<EOF
-  > from mercurial import util
-  > 
-  > def makedate():
-  >     return 0, 0
-  > def getuser():
-  >     return 'bob'
-  > # mock the date and user apis so the output is always the same
-  > def uisetup(ui):
-  >     util.makedate = makedate
-  >     util.getuser = getuser
-  > EOF
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
   > blackbox=
-  > mock=`pwd`/mock.py
+  > mock=$TESTDIR/mockblackbox.py
   > mq=
   > EOF
   $ hg init blackboxtest