예제 #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()
예제 #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()
예제 #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()
예제 #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()
예제 #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()
예제 #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()
예제 #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()
예제 #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()
예제 #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()
예제 #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
예제 #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