869146b8b9fb — Kevin Bullock 5 years ago
Test bookmark output.
2 files changed, 25 insertions(+), 0 deletions(-)

A => tests/test_bookmark.py
M tests/util.py
A => tests/test_bookmark.py +19 -0
@@ 0,0 1,19 @@ 
+'''Test output of {bookmark}.'''
+
+from nose import *
+from util import *
+
+@with_setup(setup_sandbox, teardown_sandbox)
+def test_bookmark():
+    hg_bookmark('test')
+
+    output = prompt(fs='{bookmark}')
+    assert output == 'test'
+
+@with_setup(setup_sandbox, teardown_sandbox)
+def test_no_bookmark():
+    hg_bookmark('test')
+    hg_deactivate_bookmark()
+
+    output = prompt(fs='{bookmark}')
+    assert output == ''

          
M tests/util.py +6 -0
@@ 41,6 41,12 @@ def get_sandbox_ui():
 def hg_branch(branch='test'):
     commands.branch(_ui, get_sandbox_repo(), branch)
 
+def hg_bookmark(bookmark='test'):
+    commands.bookmark(_ui, get_sandbox_repo(), bookmark)
+
+def hg_deactivate_bookmark():
+    commands.bookmark(_ui, get_sandbox_repo(), inactive=True)
+
 def hg_update(rev):
     opts = { 'rev': str(rev), }
     commands.update(_ui, get_sandbox_repo(), **opts)