def test_cli_usage(capsys): """Test if command_line_runner shows help when called without parameters.""" # def test_cli_usage(monkeypatch, capsys): # monkeypatch.setattr(sys, "argv", ["playable"]) tool.command_line_runner() out, err = capsys.readouterr() assert 'usage: playable [-h]' in out
def list_all_crids(capsys): status = tool.command_line_runner(f'playable --list_crids'.split()) return dict(status=status)
def playout(asset, capsys): status = tool.command_line_runner(f'playable {asset}'.split()) return dict(status=status)
def test_clr_play_in_integration_title_2_crid(mock_play): tool.command_line_runner('playable --env integration The Firm'.split()) mock_play.assert_called_with('458431384f556510VgnVCM1000000b43150a____', env='integration')
def test_clr_play_crid(mock_play): tool.command_line_runner('playable crid is not in list'.split()) mock_play.assert_called_with('crid', env='quality')
def test_clr_play_title_2_crid(mock_play): tool.command_line_runner('playable The Firm'.split()) mock_play.assert_called_with('458431384f556510VgnVCM1000000b43150a____', env='quality')
def test_clr_play_title(mock_play, mock_get_crid): tool.command_line_runner('playable movies only'.split()) mock_get_crid.assert_called_once() mock_play.assert_called_once()
def test_clr_list_users(mock_list_crids): tool.command_line_runner('playable --list_crids'.split()) assert mock_list_crids.list_titles.called_once()