tests: update test-commit to pass our import checker
authorAugie Fackler <raf@durin42.com>
Tue, 22 Aug 2017 15:50:01 -0400
changeset 33951 335d45e74381
parent 33950 42361715dd11
child 33952 794f7bb739be
tests: update test-commit to pass our import checker
tests/test-commit.t
--- a/tests/test-commit.t	Tue Aug 22 15:49:54 2017 -0400
+++ b/tests/test-commit.t	Tue Aug 22 15:50:01 2017 -0400
@@ -642,9 +642,10 @@
   
 verify pathauditor blocks evil filepaths
   $ cat > evil-commit.py <<EOF
-  > from mercurial import ui, hg, context, node
+  > from __future__ import absolute_import
+  > from mercurial import context, hg, node, ui as uimod
   > notrc = u".h\u200cg".encode('utf-8') + '/hgrc'
-  > u = ui.ui.load()
+  > u = uimod.ui.load()
   > r = hg.repository(u, '.')
   > def filectxfn(repo, memctx, path):
   >     return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned')
@@ -666,9 +667,10 @@
   $ hg rollback -f
   repository tip rolled back to revision 2 (undo commit)
   $ cat > evil-commit.py <<EOF
-  > from mercurial import ui, hg, context, node
+  > from __future__ import absolute_import
+  > from mercurial import context, hg, node, ui as uimod
   > notrc = "HG~1/hgrc"
-  > u = ui.ui.load()
+  > u = uimod.ui.load()
   > r = hg.repository(u, '.')
   > def filectxfn(repo, memctx, path):
   >     return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned')
@@ -684,9 +686,10 @@
   $ hg rollback -f
   repository tip rolled back to revision 2 (undo commit)
   $ cat > evil-commit.py <<EOF
-  > from mercurial import ui, hg, context, node
+  > from __future__ import absolute_import
+  > from mercurial import context, hg, node, ui as uimod
   > notrc = "HG8B6C~2/hgrc"
-  > u = ui.ui.load()
+  > u = uimod.ui.load()
   > r = hg.repository(u, '.')
   > def filectxfn(repo, memctx, path):
   >     return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned')