Ejemplo n.º 1
0
def test_report_collection_diff_different():
    """Test reporting of different collections."""
    from_collection = ['aaa', 'bbb', 'ccc', 'YYY']
    to_collection = ['aZa', 'bbb', 'XXX', 'ccc']
    error_message = (
        'Different tests were collected between 1 and 2. The difference is:\n'
        '--- 1\n'
        '\n'
        '+++ 2\n'
        '\n'
        '@@ -1,4 +1,4 @@\n'
        '\n'
        '-aaa\n'
        '+aZa\n'
        ' bbb\n'
        '+XXX\n'
        ' ccc\n'
        '-YYY')

    msg = report_collection_diff(from_collection, to_collection, '1', '2')
    assert msg == error_message
Ejemplo n.º 2
0
def test_report_collection_diff_different():
    """Test reporting of different collections."""
    from_collection = ['aaa', 'bbb', 'ccc', 'YYY']
    to_collection = ['aZa', 'bbb', 'XXX', 'ccc']
    error_message = (
        'Different tests were collected between 1 and 2. The difference is:\n'
        '--- 1\n'
        '\n'
        '+++ 2\n'
        '\n'
        '@@ -1,4 +1,4 @@\n'
        '\n'
        '-aaa\n'
        '+aZa\n'
        ' bbb\n'
        '+XXX\n'
        ' ccc\n'
        '-YYY')

    msg = report_collection_diff(from_collection, to_collection, 1, 2)
    assert msg == error_message
Ejemplo n.º 3
0
def test_report_collection_diff_equal():
    """Test reporting of equal collections."""
    from_collection = to_collection = ['aaa', 'bbb', 'ccc']
    assert report_collection_diff(from_collection, to_collection, 1, 2) is None
Ejemplo n.º 4
0
def test_report_collection_diff_equal():
    """Test reporting of equal collections."""
    from_collection = to_collection = ['aaa', 'bbb', 'ccc']
    assert report_collection_diff(from_collection, to_collection, 1, 2) is None