예제 #1
0
def test_board_show_board_add_help():
    """Test that invalid API key gives a meaningful error response"""
    helper_check_cli(
        args=["board add"],
        expected_content=["Create a new board.", "-n, --name TEXT"],
        exit_code=0,
    )
예제 #2
0
def test_board_show_all():
    """Test that the board command shows whether boards are present or not"""
    helper_check_cli(args=["board show -a", "board show --all"],
                     expected_content=[
                         "Board ID:",
                     ],
                     exit_code=0)
예제 #3
0
def test_list_show_all():
    """Test that the list command shows whether lists are present or not"""
    helper_check_cli(args=["list show -a", "list show --all"],
                     expected_content=[
                         "Board ID:",
                         "List ID:",
                     ],
                     exit_code=0)
예제 #4
0
def test_board_show_help():
    helper_check_cli(args=["board show", "board show -h", "board show --help"],
                     expected_content=[
                         "Usage:",
                         "Show all boards.",
                         "-a, --all",
                         "-i, --id TEXT",
                     ],
                     exit_code=0)
예제 #5
0
def test_card_show_all():
    """Test that the card command shows whether cards are present or not"""
    helper_check_cli(args=["card show -a", "card show --all"],
                     expected_content=[
                         "Board ID:",
                         "List ID:",
                         "Card ID:",
                         "Label(s)",
                         "Comment ID:",
                     ],
                     exit_code=0)
예제 #6
0
def test_list_show_by_id():
    """Test that the card command shows whether cards are present or not"""
    helper_check_cli(args=[
        f"list show --id {CardOps.list.id}", f"list show -i {CardOps.list.id}"
    ],
                     expected_content=[
                         "Board ID:",
                         "List ID:",
                         "Card ID:",
                         "Label(s)",
                         "Comment ID:",
                     ],
                     exit_code=0)
예제 #7
0
def test_card_show_by_id(card_operations):
    """Test that the card command shows whether cards are present or not"""
    helper_check_cli(args=[
        f"card show --id {card_operations.card_id}",
        f"card show -i {card_operations.card_id}"
    ],
                     expected_content=[
                         "Board ID:",
                         "List ID:",
                         "Card ID:",
                         "Label(s)",
                         "Comment ID:",
                     ],
                     exit_code=0)
예제 #8
0
def test_board_valid_id_but_missing_resource():
    helper_check_cli(
        args=["board show -i 123456789123456789123456"],
        expected_content=["Error: 404: The requested resource was not found."],
        exit_code=1,
        strict=True)
예제 #9
0
def test_board_invalid_id():
    helper_check_cli(args=["board show -i bad_board_id"],
                     expected_content=["Error: 400: invalid id"],
                     exit_code=1,
                     strict=True)
예제 #10
0
def test_board_invalid_api_key():
    """Test that invalid API key gives a meaningful error response"""
    helper_check_cli(args=["-k api -t token board show"],
                     expected_content=["Error: 401: invalid key"],
                     exit_code=1,
                     strict=True)
예제 #11
0
def test_list_valid_id_but_missing_resource():
    helper_check_cli(args=["list show -i 123456789123456789123456"],
                     expected_content=["Error: 404: model not found"],
                     exit_code=1,
                     strict=True)