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()
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()
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()
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()
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()
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()
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()
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
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