예제 #1
0
def test_no_tests_are_done_if_no_manifest_json():
    err = setup_err()
    manifestjson.test_manifest_json_params(err)
    assert not err.failed()
예제 #2
0
def test_version_is_required():
    with setup_err_and_manifest() as (err, manifest):
        del manifest['version']
    manifestjson.test_manifest_json_params(err)
    assert err.failed(), 'expected version to be required'
예제 #3
0
def test_version_must_be_valid():
    with setup_err_and_manifest() as (err, manifest):
        manifest['version'] = '2.5 beta'
    manifestjson.test_manifest_json_params(err)
    assert err.failed(), 'expected invalid version to fail'
예제 #4
0
def test_id_is_required():
    with setup_err_and_manifest() as (err, manifest):
        del manifest['applications']
    manifestjson.test_manifest_json_params(err)
    assert err.failed(), 'expected id to be required'
예제 #5
0
def test_id_is_required_to_be_valid():
    with setup_err_and_manifest() as (err, manifest):
        manifest['applications']['gecko']['id'] = 'not valid'
    manifestjson.test_manifest_json_params(err)
    assert err.failed(), 'expected id to be invalid'
예제 #6
0
def test_name_is_required():
    with setup_err_and_manifest() as (err, manifest):
        del manifest['name']
    manifestjson.test_manifest_json_params(err)
    assert err.failed(), 'expected name to be required'
예제 #7
0
def test_name_cannot_have_trademarks():
    with setup_err_and_manifest() as (err, manifest):
        manifest['name'] = 'Mozilla Addon'
    manifestjson.test_manifest_json_params(err)
    assert err.failed(), 'expected name with Mozilla to fail'
예제 #8
0
def test_valid_manifest_json_is_valid():
    err = setup_err(valid_manifest_json())
    manifestjson.test_manifest_json_params(err)
    assert not err.failed(), 'expected valid manifest.json to pass'