@@ -1576,8 +1576,14 @@ def do_affirmative(self, arg):
15761576 self ._last_result = cmd2 .CommandResult (arg , data = True )
15771577
15781578 def do_negative (self , arg ):
1579+ self ._last_result = cmd2 .CommandResult (arg , data = False )
1580+
1581+ def do_affirmative_no_data (self , arg ):
15791582 self ._last_result = cmd2 .CommandResult (arg )
15801583
1584+ def do_negative_no_data (self , arg ):
1585+ self ._last_result = cmd2 .CommandResult ('' , arg )
1586+
15811587@pytest .fixture
15821588def commandresult_app ():
15831589 app = CommandResultApp ()
@@ -1590,11 +1596,19 @@ def test_commandresult_truthy(commandresult_app):
15901596 assert commandresult_app ._last_result
15911597 assert commandresult_app ._last_result == cmd2 .CommandResult (arg , data = True )
15921598
1599+ run_cmd (commandresult_app , 'affirmative_no_data {}' .format (arg ))
1600+ assert commandresult_app ._last_result
1601+ assert commandresult_app ._last_result == cmd2 .CommandResult (arg )
1602+
15931603def test_commandresult_falsy (commandresult_app ):
15941604 arg = 'bar'
15951605 run_cmd (commandresult_app , 'negative {}' .format (arg ))
15961606 assert not commandresult_app ._last_result
1597- assert commandresult_app ._last_result == cmd2 .CommandResult (arg )
1607+ assert commandresult_app ._last_result == cmd2 .CommandResult (arg , data = False )
1608+
1609+ run_cmd (commandresult_app , 'negative_no_data {}' .format (arg ))
1610+ assert not commandresult_app ._last_result
1611+ assert commandresult_app ._last_result == cmd2 .CommandResult ('' , arg )
15981612
15991613
16001614def test_is_text_file_bad_input (base_app ):
0 commit comments