コード例 #1
0
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
コード例 #2
0
def list_all_crids(capsys):
    status = tool.command_line_runner(f'playable --list_crids'.split())
    return dict(status=status)
コード例 #3
0
def playout(asset, capsys):
    status = tool.command_line_runner(f'playable {asset}'.split())
    return dict(status=status)
コード例 #4
0
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')
コード例 #5
0
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')
コード例 #6
0
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')
コード例 #7
0
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()
コード例 #8
0
def test_clr_list_users(mock_list_crids):
    tool.command_line_runner('playable --list_crids'.split())
    assert mock_list_crids.list_titles.called_once()