Exemplo n.º 1
0
def test_search_bad_type():
    "Tests the submain test_search function with a bad package type."

    err = ErrorBundle()
    submain.detect_opensearch = lambda err, x, listed: err
    submain.test_search(err, None, PACKAGE_THEME)

    assert err.failed()
Exemplo n.º 2
0
def test_search_pass():
    "Tests the submain test_search function with passing data."

    err = ErrorBundle()
    submain.detect_opensearch = lambda err, x, listed: err
    submain.test_search(err, None, PACKAGE_ANY)

    assert not err.failed()
Exemplo n.º 3
0
def test_search_pass():
    "Tests the submain test_search function with passing data."

    err = ErrorBundle()
    submain.detect_opensearch = lambda err, x, listed: err
    submain.test_search(err, None, PACKAGE_ANY)

    assert not err.failed()
Exemplo n.º 4
0
def test_search_bad_type():
    "Tests the submain test_search function with a bad package type."

    err = ErrorBundle()
    submain.detect_opensearch = lambda err, x, listed: err
    submain.test_search(err, None, PACKAGE_THEME)

    assert err.failed()
Exemplo n.º 5
0
def test_search_bad_type():
    "Tests the submain test_search function with a bad package type."
    
    err = ErrorBundle(None, True)
    submain.detect_opensearch = lambda x: {"failure":False}
    submain.test_search(err, None, PACKAGE_THEME)
    
    assert err.failed()
Exemplo n.º 6
0
def test_search_pass():
    "Tests the submain test_search function with passing data."
    
    err = ErrorBundle(None, True)
    submain.detect_opensearch = lambda x: {"failure":False}
    submain.test_search(err, None, PACKAGE_ANY)
    
    assert not err.failed()
Exemplo n.º 7
0
def test_search_failure_undecided():
    "Tests the submain test_search function with an unrejected fail case"

    err = ErrorBundle()
    submain.detect_opensearch = lambda err, x, listed: err.error(
        ("foo", ), "Test")
    submain.test_search(err, None, PACKAGE_ANY)

    assert err.failed()
Exemplo n.º 8
0
def test_search_failure_undecided():
    "Tests the submain test_search function with an unrejected fail case"

    err = ErrorBundle()
    submain.detect_opensearch = lambda err, x, listed: err.error(("foo", ),
                                                                  "Test")
    submain.test_search(err, None, PACKAGE_ANY)

    assert err.failed()
Exemplo n.º 9
0
def test_search_failure():
    'Tests the submain test_search function with a failure'

    err = ErrorBundle()
    submain.detect_opensearch = (
        lambda err, x, listed: err.error(('foo', ), 'Test'))
    submain.test_search(err, None, PACKAGE_ANY)

    assert err.failed()
Exemplo n.º 10
0
def test_search_failure():
    "Tests the submain test_search function with a failure"
    
    err = ErrorBundle(None, True)
    submain.detect_opensearch = lambda x: {"failure":True,
                                           "error":""}
    submain.test_search(err, None, PACKAGE_ANY)
    
    assert err.failed()
    assert err.reject
Exemplo n.º 11
0
def test_search_failure_undecided():
    "Tests the submain test_search function with an unrejected fail case"
    
    err = ErrorBundle(None, True)
    submain.detect_opensearch = lambda x: {"failure":True,
                                           "error":"",
                                           "decided":False}
    submain.test_search(err, None, PACKAGE_ANY)
    
    assert err.failed()
    assert not err.reject