コード例 #1
0
ファイル: test_database.py プロジェクト: Grimy/qibuild
def test_downloads_only_once(toolchain_db, feed):
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.42")
    feed.add_package(boost_package, with_path=False, with_url=True)
    with mock.patch.object(toolchain_db, "download_package") as mock_dl:
        toolchain_db.update(feed.url)
        toolchain_db.update(feed.url)
    assert mock_dl.call_count == 1
コード例 #2
0
ファイル: test_database.py プロジェクト: cameronyoyos/qibuild
def test_downloads_only_once(toolchain_db, feed):
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.42")
    feed.add_package(boost_package, with_path=False, with_url=True)
    with mock.patch.object(toolchain_db, "download_package") as mock_dl:
        toolchain_db.update(feed.url)
        toolchain_db.update(feed.url)
    assert mock_dl.call_count == 1
コード例 #3
0
ファイル: test_fixture.py プロジェクト: Grimy/qibuild
def test_feed(feed):
    boost_package = qitoolchain.qipackage.QiPackage("boost", "1.42")
    boost_package.url = "ftp://example.org/boost-1.42.zip"
    feed.add_package(boost_package)
    parser = qitoolchain.feed.ToolchainFeedParser()
    parser.parse(feed.url)
    packages = parser.get_packages()
    assert packages[0].url == boost_package.url
コード例 #4
0
ファイル: test_fixture.py プロジェクト: trb116/pythonanalyzer
def test_feed(feed):
    boost_package = qitoolchain.qipackage.QiPackage("boost", "1.42")
    boost_package.url = "ftp://example.org/boost-1.42.zip"
    feed.add_package(boost_package)
    parser = qitoolchain.feed.ToolchainFeedParser("foo")
    parser.parse(feed.url)
    packages = parser.get_packages()
    assert packages[0].url == boost_package.url
コード例 #5
0
ファイル: test_database.py プロジェクト: cameronyoyos/qibuild
def test_package_removed_from_feed(toolchain_db, feed):
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.42")
    feed.add_package(boost_package)
    toolchain_db.update(feed.url)

    feed.remove_package("boost")
    toolchain_db.update(feed.url)
    assert not toolchain_db.packages
コード例 #6
0
ファイル: test_database.py プロジェクト: cameronyoyos/qibuild
def test_package_removed_from_feed(toolchain_db, feed):
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.42")
    feed.add_package(boost_package)
    toolchain_db.update(feed.url)

    feed.remove_package("boost")
    toolchain_db.update(feed.url)
    assert not toolchain_db.packages
コード例 #7
0
def test_package_removed_from_feed(toolchain_db, feed):
    """ Test Package Removed from Feed """
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.42")
    feed.add_package(boost_package)
    toolchain_db.update(feed.url)
    boost_path = toolchain_db.get_package_path("boost")
    feed.remove_package("boost")
    toolchain_db.update(feed.url)
    assert not toolchain_db.packages
    assert not os.path.exists(boost_path)
コード例 #8
0
ファイル: test_database.py プロジェクト: aldebaran/qibuild
def test_package_removed_from_feed(toolchain_db, feed):
    """ Test Package Removed from Feed """
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.42")
    feed.add_package(boost_package)
    toolchain_db.update(feed.url)
    boost_path = toolchain_db.get_package_path("boost")
    feed.remove_package("boost")
    toolchain_db.update(feed.url)
    assert not toolchain_db.packages
    assert not os.path.exists(boost_path)
コード例 #9
0
def test_downloads_only_once(toolchain_db, feed):
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.42")
    feed.add_package(boost_package, with_path=False, with_url=True)
    with mock.patch.object(qisys.remote, "download") as mock_dl:
        with mock.patch.object(qitoolchain.qipackage, "extract") as mock_extract:
            mock_dl.return_value = "/path/to/boost.zip"
            toolchain_db.update(feed.url)
            toolchain_db.update(feed.url)
    assert mock_dl.call_count == 1
    assert mock_extract.call_count == 1
    assert mock_extract.call_args_list[0][0][0] == "/path/to/boost.zip"
コード例 #10
0
ファイル: test_database.py プロジェクト: Grimy/qibuild
def test_downgrading_package(toolchain_db, feed):
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.44")
    feed.add_package(boost_package)

    toolchain_db.update(feed.url)
    assert toolchain_db.packages["boost"] == boost_package

    old_boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.42")
    feed.add_package(old_boost_package)
    toolchain_db.update(feed.url)
    assert toolchain_db.packages["boost"] == old_boost_package
コード例 #11
0
ファイル: test_database.py プロジェクト: Grimy/qibuild
def test_update(toolchain_db, feed):
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.42")
    feed.add_package(boost_package)

    toolchain_db.update(feed.url)
    assert toolchain_db.packages["boost"] == boost_package

    new_boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.44")
    feed.add_package(new_boost_package)
    toolchain_db.update(feed.url)
    assert toolchain_db.packages["boost"] == new_boost_package
コード例 #12
0
def test_downgrading_package(toolchain_db, feed):
    """ Test Downgrading Package """
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.44")
    feed.add_package(boost_package)
    toolchain_db.update(feed.url)
    assert toolchain_db.packages["boost"] == boost_package
    feed.remove_package("boost")
    old_boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.42")
    feed.add_package(old_boost_package)
    toolchain_db.update(feed.url)
    assert toolchain_db.packages["boost"] == old_boost_package
コード例 #13
0
ファイル: test_database.py プロジェクト: s-abhishek93/qibuild
def test_downloads_only_once(toolchain_db, feed):
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.42")
    feed.add_package(boost_package, with_path=False, with_url=True)
    with mock.patch.object(qisys.remote, "download") as mock_dl:
        with mock.patch.object(qitoolchain.qipackage,
                               "extract") as mock_extract:
            mock_dl.return_value = "/path/to/boost.zip"
            toolchain_db.update(feed.url)
            toolchain_db.update(feed.url)
    assert mock_dl.call_count == 1
    assert mock_extract.call_count == 1
    assert mock_extract.call_args_list[0][0][0] == "/path/to/boost.zip"
コード例 #14
0
def test_svn_package_conflict(toolchain_db, feed, svn_server):
    """ Test SVN Package Conflict """
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.44")
    feed.add_package(boost_package)
    toolchain = qitoolchain.toolchain.Toolchain("foo")
    toolchain.update(feed.url)
    boost_url = svn_server.create_repo("boost")
    svn_server.commit_file("boost", "version.hpp", '#define BOOST_VERSION "1_55"\n')
    svn_package = qitoolchain.svn_package.SvnPackage("boost")
    svn_package.url = boost_url
    feed.add_svn_package(svn_package)
    toolchain.update(feed.url)
コード例 #15
0
ファイル: test_database.py プロジェクト: cameronyoyos/qibuild
def test_update(toolchain_db, feed):
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.42")
    feed.add_package(boost_package)

    toolchain_db.update(feed.url)
    assert toolchain_db.packages["boost"] == boost_package

    new_boost_package = qitoolchain.qipackage.QiPackage("boost",
                                                        version="1.44")
    feed.add_package(new_boost_package)
    toolchain_db.update(feed.url)
    assert toolchain_db.packages["boost"] == new_boost_package
コード例 #16
0
def test_update(toolchain_db, feed):
    """ Test Update """
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.42")
    boost_package.path = "/path/to/boost"
    feed.add_package(boost_package)
    toolchain_db.update(feed.url)
    assert toolchain_db.packages["boost"] == boost_package
    new_boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.44")
    new_boost_package.path = "/path/to/boost"
    feed.add_package(new_boost_package)
    toolchain_db.update(feed.url)
    assert toolchain_db.packages["boost"] == new_boost_package
コード例 #17
0
def test_git_feed(toolchain_db, feed, git_server):
    """ Test Git Feed """
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.44")
    feed.add_package(boost_package)
    git_server.create_repo("toolchains.git")
    git_server.push_file("toolchains.git", "feeds/foo.xml", feed.feed_xml.read())
    url = git_server.get_repo("toolchains.git").clone_url
    toolchain = qitoolchain.toolchain.Toolchain("foo")
    toolchain.update(url, branch="master", name="foo")
    boost = toolchain.get_package("boost")
    assert boost.version == "1.44"
    new_boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.55")
    feed.add_package(new_boost_package)
    git_server.push_file("toolchains.git", "feeds/foo.xml", feed.feed_xml.read())
    toolchain.update()
    boost = toolchain.get_package("boost")
    assert boost.version == "1.55"
コード例 #18
0
ファイル: test_database.py プロジェクト: s-abhishek93/qibuild
def test_downloads_remote_package(toolchain_db, feed):
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.42")
    feed.add_package(boost_package, with_path=False, with_url=True)

    toolchain_db.update(feed.url)
    assert toolchain_db.packages["boost"].path
コード例 #19
0
def test_downloads_remote_package(toolchain_db, feed):
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.42")
    feed.add_package(boost_package, with_path=False, with_url=True)

    toolchain_db.update(feed.url)
    assert toolchain_db.packages["boost"].path