Пример #1
0
def test_adding_same_package_twice(toolchain_db):
    """ Test Adding Same Package Twice """
    foo_package = qitoolchain.qipackage.QiPackage("foo", version="1.3")
    foo_package.path = "/path/to/foo"
    toolchain_db.add_package(foo_package)
    toolchain_db.add_package(foo_package)
    assert len(toolchain_db.packages) == 1
Пример #2
0
def test_adding_same_package_twice(toolchain_db):
    """ Test Adding Same Package Twice """
    foo_package = qitoolchain.qipackage.QiPackage("foo", version="1.3")
    foo_package.path = "/path/to/foo"
    toolchain_db.add_package(foo_package)
    toolchain_db.add_package(foo_package)
    assert len(toolchain_db.packages) == 1
Пример #3
0
def test_persistent(toolchain_db):
    """ Test Percistent """
    foo_package = qitoolchain.qipackage.QiPackage("foo", version="1.3")
    foo_package.path = "/path/to/foo"
    toolchain_db.add_package(foo_package)
    toolchain_db.save()
    db2 = qitoolchain.database.DataBase("bar", toolchain_db.db_path)
    actual_package = db2.packages["foo"]
    assert actual_package == foo_package
Пример #4
0
def test_persistent(toolchain_db):
    """ Test Percistent """
    foo_package = qitoolchain.qipackage.QiPackage("foo", version="1.3")
    foo_package.path = "/path/to/foo"
    toolchain_db.add_package(foo_package)
    toolchain_db.save()
    db2 = qitoolchain.database.DataBase("bar", toolchain_db.db_path)
    actual_package = db2.packages["foo"]
    assert actual_package == foo_package
Пример #5
0
def test_solve_deps(toolchain_db, tmpdir):
    """ Test Solve Dependencies """
    bar_path = tmpdir.ensure("bar", dir=True)
    bar_path.join("package.xml").write(
        """<package name="bar">\n  <depends buildtime="true" names="foo" />\n</package>"""
    )
    foo_path = tmpdir.ensure("foo", dir=True)
    bar_package = qitoolchain.qipackage.QiPackage("bar")
    bar_package.path = bar_path.strpath
    foo_package = qitoolchain.qipackage.QiPackage("foo")
    foo_package.path = foo_path.strpath
    toolchain_db.add_package(bar_package)
    toolchain_db.add_package(foo_package)
    res = toolchain_db.solve_deps([bar_package], dep_types=["build"])
    assert res == [foo_package, bar_package]
Пример #6
0
def test_solve_deps(toolchain_db, tmpdir):
    """ Test Solve Dependencies """
    bar_path = tmpdir.ensure("bar", dir=True)
    bar_path.join("package.xml").write(
        """<package name="bar">\n  <depends buildtime="true" names="foo" />\n</package>"""
    )
    foo_path = tmpdir.ensure("foo", dir=True)
    bar_package = qitoolchain.qipackage.QiPackage("bar")
    bar_package.path = bar_path.strpath
    foo_package = qitoolchain.qipackage.QiPackage("foo")
    foo_package.path = foo_path.strpath
    toolchain_db.add_package(bar_package)
    toolchain_db.add_package(foo_package)
    res = toolchain_db.solve_deps([bar_package], dep_types=["build"])
    assert res == [foo_package, bar_package]