Ejemplo n.º 1
0
def test_SourceInstaller_resolve():
    from rosdep2.platforms.source import SourceInstaller, InvalidData
    test_dir = get_test_dir()

    url = 'https://kforge.ros.org/rosrelease/rosdep/raw-file/908818f28156/test/source/rep112-example.rdmanifest'
    md5sum_good = 'af0dc0e2d0c0c3181dd7670c4147f155'
    md5sum_bad = 'fake'

    installer = SourceInstaller()
    try:
        installer.resolve({})
        assert False, "should have raised"
    except InvalidData:
        pass
    try:
        installer.resolve(dict(uri=url, md5sum=md5sum_bad))
        assert False, "should have raised"
    except InvalidData:
        pass
    resolved = installer.resolve(dict(uri=url, md5sum=md5sum_good))
        
    assert type(resolved) == list
    assert len(resolved) == 1
    resolved = resolved[0]

    assert resolved.install_command == rep122_install_command
    assert resolved.check_presence_command == rep122_check_presence_command

    # test again to activate caching
    resolved = installer.resolve(dict(uri=url, md5sum=md5sum_good))
    assert resolved.install_command == rep122_install_command
    assert resolved.check_presence_command == rep122_check_presence_command
Ejemplo n.º 2
0
def test_SourceInstaller_resolve():
    from rosdep2.platforms.source import SourceInstaller, InvalidData
    test_dir = get_test_dir()

    url = 'https://kforge.ros.org/rosrelease/rosdep/raw-file/908818f28156/test/source/rep112-example.rdmanifest'
    md5sum_good = 'af0dc0e2d0c0c3181dd7670c4147f155'
    md5sum_bad = 'fake'

    installer = SourceInstaller()
    try:
        installer.resolve({})
        assert False, "should have raised"
    except InvalidData:
        pass
    try:
        installer.resolve(dict(uri=url, md5sum=md5sum_bad))
        assert False, "should have raised"
    except InvalidData:
        pass
    resolved = installer.resolve(dict(uri=url, md5sum=md5sum_good))

    assert type(resolved) == list
    assert len(resolved) == 1
    resolved = resolved[0]

    assert resolved.install_command == rep122_install_command
    assert resolved.check_presence_command == rep122_check_presence_command

    # test again to activate caching
    resolved = installer.resolve(dict(uri=url, md5sum=md5sum_good))
    assert resolved.install_command == rep122_install_command
    assert resolved.check_presence_command == rep122_check_presence_command
Ejemplo n.º 3
0
def test_SourceInstaller_resolve():
    from rosdep2.platforms.source import SourceInstaller, InvalidData
    test_dir = get_test_dir()

    url = 'file://%s' % os.path.join(test_dir, 'rep112-example.rdmanifest')
    md5sum_good = REP112_MD5SUM
    md5sum_bad = 'fake'

    installer = SourceInstaller()
    try:
        installer.resolve({})
        assert False, "should have raised"
    except InvalidData:
        pass
    try:
        installer.resolve(dict(uri=url, md5sum=md5sum_bad))
        assert False, "should have raised"
    except InvalidData:
        pass
    resolved = installer.resolve(dict(uri=url, md5sum=md5sum_good))

    assert type(resolved) == list
    assert len(resolved) == 1
    # test for reinstall (to check the depends in rdmanifest)
    dependencies = installer.get_depends(dict(uri=url, md5sum=md5sum_good))
    assert dependencies == [
        'checkinstall'
    ], "Dependencies should resolve to checkinstall listed in the rdmanifest."
    resolved = resolved[0]

    assert resolved.install_command == rep122_install_command
    assert resolved.check_presence_command == rep122_check_presence_command

    # test again to activate caching
    resolved = installer.resolve(dict(uri=url, md5sum=md5sum_good))
    assert type(resolved) == list, "Cache should also return a list"
    assert len(resolved) == 1
    resolved = resolved[0]
    assert resolved.install_command == rep122_install_command
    assert resolved.check_presence_command == rep122_check_presence_command
Ejemplo n.º 4
0
def test_SourceInstaller_resolve():
    from rosdep2.platforms.source import SourceInstaller, InvalidData
    test_dir = get_test_dir()

    url = 'file://%s' % os.path.join(test_dir, 'rep112-example.rdmanifest')
    md5sum_good = REP112_MD5SUM
    md5sum_bad = 'fake'

    installer = SourceInstaller()
    try:
        installer.resolve({})
        assert False, "should have raised"
    except InvalidData:
        pass
    try:
        installer.resolve(dict(uri=url, md5sum=md5sum_bad))
        assert False, "should have raised"
    except InvalidData:
        pass
    resolved = installer.resolve(dict(uri=url, md5sum=md5sum_good))
        
    assert type(resolved) == list
    assert len(resolved) == 1
    # test for reinstall (to check the depends in rdmanifest)
    dependencies = installer.get_depends(dict(uri=url, md5sum=md5sum_good))
    assert dependencies == ['checkinstall'], "Dependencies should resolve to checkinstall listed in the rdmanifest."
    resolved = resolved[0]

    assert resolved.install_command == rep122_install_command
    assert resolved.check_presence_command == rep122_check_presence_command

    # test again to activate caching
    resolved = installer.resolve(dict(uri=url, md5sum=md5sum_good))
    assert type(resolved) == list, "Cache should also return a list"
    assert len(resolved) == 1
    resolved = resolved[0]
    assert resolved.install_command == rep122_install_command
    assert resolved.check_presence_command == rep122_check_presence_command