Commits

mdelagra committed 0a23e86

added tests for --target-groups and --target-people opts

Comments (0)

Files changed (2)

mercurial_reviewboard/tests/test_commands.py

 def test_update():
     opts = {}
     args = fancyopts.fancyopts(['-u'], cmdtable['postreview'][1], opts, True)
-    eq_(True, opts['update'])    
+    eq_(True, opts['update'])    
+    
+def test_target_groups():
+    opts = {}
+    args = fancyopts.fancyopts(['-G', 'foo, bar'], cmdtable['postreview'][1], 
+                               opts, True)
+    eq_(['foo, bar'], opts['target_groups'])
+
+def test_target_people():
+    opts = {}
+    args = fancyopts.fancyopts(['-U', 'john, jane'], cmdtable['postreview'][1], 
+                               opts, True)
+    eq_(['john, jane'], opts['target_people'])

mercurial_reviewboard/tests/test_createfields.py

     
     return ui, repo, c, parentc, opts
 
+def test_target_people():
+    ui, repo, c, parentc, opts = set_up_two_revs()
+    opts['target_people'] = ['john, jane']
+    fields = createfields(ui, repo, c, parentc, opts)
+    eq_('john, jane', fields['target_people'])
+    
+def test_target_groups():
+    ui, repo, c, parentc, opts = set_up_two_revs()
+    opts['target_groups'] = ['foo, bar']
+    fields = createfields(ui, repo, c, parentc, opts)
+    eq_('foo, bar', fields['target_groups'])
+
 class TestCreateFieldsRevisionDetails:
     
     def setup(self):