예제 #1
0
def test_malformed_pack_id():
    assert script.find_malformed_pack_id(MALFORMED_PACK_RESPONSE_BODY) == [
        'pack1'
    ]
    assert script.find_malformed_pack_id(
        MALFORMED_PACK_RESPONSE_BODY_TWO_PACKS) == ['pack1', 'pack2']
    assert script.find_malformed_pack_id(ERROR_AS_LIST_RESPONSE_BODY) == []
예제 #2
0
def test_not_find_malformed_pack_id():
    """
    Given
    - Error message without any pack ID.
    When
    - Run find_malformed_pack_id command.
    Then
    - Ensure Exception is returned with the error message.
    """
    with pytest.raises(Exception, match='The request to install packs has failed. '
                                        'Reason: This is an error message without pack ID'):
        script.find_malformed_pack_id('This is an error message without pack ID')
예제 #3
0
def test_not_find_malformed_pack_id():
    """
    Given
    - Error message without any pack ID.
    When
    - Run find_malformed_pack_id command.
    Then
    - Ensure an empty list is returned.
    """
    assert script.find_malformed_pack_id('This is an error message without pack ID') == []
예제 #4
0
def test_find_malformed_pack_id():
    """
    Given
    - Error message.
    When
    - Run find_malformed_pack_id command.
    Then
    - Ensure the pack ID is caught.
   """
    malformed_pack_id = script.find_malformed_pack_id(ERROR_MESSAGE)
    assert 'AutoFocus' in malformed_pack_id