當前位置: 首頁>>代碼示例>>Python>>正文


Python Index.delete方法代碼示例

本文整理匯總了Python中curdling.index.Index.delete方法的典型用法代碼示例。如果您正苦於以下問題:Python Index.delete方法的具體用法?Python Index.delete怎麽用?Python Index.delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在curdling.index.Index的用法示例。


在下文中一共展示了Index.delete方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_retrieve_and_build

# 需要導入模塊: from curdling.index import Index [as 別名]
# 或者: from curdling.index.Index import delete [as 別名]
def test_retrieve_and_build():
    "Install#retrieve_and_build() "

    # Given that I have an installer with a working index
    index = Index(FIXTURE('tmp'))
    installer = Install(**{
        'conf': {
            'index': index,
            'pypi_urls': ['http://localhost:8000/simple']
        },
    })
    installer.pipeline()

    # And I feed the installer with a requirement
    installer.feed('tests', requirement='gherkin')

    # And start the installer
    installer.start()

    # When I run the retrieve and build loop
    packages = installer.retrieve_and_build()

    # Than I see that the package was retrieved
    packages.should.equal(set(['gherkin']))

    # And I clean the mess
    index.delete()
開發者ID:harobed,項目名稱:curdling,代碼行數:29,代碼來源:test_main.py

示例2: test_downloader

# 需要導入模塊: from curdling.index import Index [as 別名]
# 或者: from curdling.index.Index import delete [as 別名]
def test_downloader():
    "It should be possible to download packages from pip repos"

    # Given the following downloader component
    sources = [PipSource(urls=['http://localhost:8000/simple'])]
    index = Index(FIXTURE('tmpindex'))
    downloader = DownloadManager(sources=sources, index=index)

    # When I try to retrieve a package from it
    package = downloader.retrieve('gherkin==0.1.0', 'main')

    # Then I see that the package was downloaded correctly to the storage
    index.get('gherkin==0.1.0').should_not.be.empty

    # And I cleanup the mess
    index.delete()
開發者ID:pombredanne,項目名稱:curdling,代碼行數:18,代碼來源:test_main.py

示例3: test_index_from_data

# 需要導入模塊: from curdling.index import Index [as 別名]
# 或者: from curdling.index.Index import delete [as 別名]
def test_index_from_data():
    "It should be possible to index data from memory"

    # Given the following index
    index = Index(FIXTURE('index'))

    # When I index a file
    data = open(FIXTURE('storage1/gherkin-0.1.0.tar.gz'), 'rb').read()
    index.from_data(path='gherkin-0.1.0.tar.gz', data=data)

    # Then I see it inside of the index
    index.get('gherkin==0.1.0').should.equal(
        FIXTURE('index/gherkin-0.1.0.tar.gz'),
    )

    # And I clean the mess
    index.delete()
開發者ID:pombredanne,項目名稱:curdling,代碼行數:19,代碼來源:test_index.py

示例4: test_index_from_file

# 需要導入模塊: from curdling.index import Index [as 別名]
# 或者: from curdling.index.Index import delete [as 別名]
def test_index_from_file():
    "It should be possible to index packages from files"

    # Given the following index
    index = Index(FIXTURE('index'))

    # When I index a file
    index.from_file(FIXTURE('storage1/gherkin-0.1.0.tar.gz'))

    # Then I see it inside of the index
    index.get('gherkin==0.1.0;gz').should.equal(
        FIXTURE('index/gherkin-0.1.0.tar.gz'),
    )

    # And that there's no wheel available yet
    index.get.when.called_with('gherkin==0.1.0;whl').should.throw(
        PackageNotFound,
    )

    # And I clean the mess
    index.delete()
開發者ID:pombredanne,項目名稱:curdling,代碼行數:23,代碼來源:test_index.py

示例5: test_downloader

# 需要導入模塊: from curdling.index import Index [as 別名]
# 或者: from curdling.index.Index import delete [as 別名]
def test_downloader():
    "It should be possible to download packages from pip repos"

    # Given that I have a finder pointing to our local pypi server
    finder = Finder(**{"conf": {"pypi_urls": ["http://localhost:8000/simple"]}})

    # And a downloader pointing to a temporary index
    index = Index(FIXTURE("tmpindex"))
    downloader = Downloader(**{"index": index})

    # When I find the link
    link = finder.handle("tests", {"requirement": "gherkin (== 0.1.0)"})

    # And When I try to retrieve a package from it
    downloader.handle("main", link)

    # Then I see that the package was downloaded correctly to the storage
    index.get("gherkin==0.1.0").should_not.be.empty

    # And I cleanup the mess
    index.delete()
開發者ID:qrees,項目名稱:curdling,代碼行數:23,代碼來源:test_main.py

示例6: test_retrieve_and_build

# 需要導入模塊: from curdling.index import Index [as 別名]
# 或者: from curdling.index.Index import delete [as 別名]
def test_retrieve_and_build():
    "Install#retrieve_and_build() "

    # Given that I have an installer with a working index
    index = Index(FIXTURE("tmp"))
    installer = Install(**{"conf": {"index": index, "pypi_urls": ["http://localhost:8000/simple"]}})
    installer.pipeline()

    # And I handle the installer with a requirement
    installer.queue("tests", requirement="gherkin")

    # And start the installer
    installer.start()

    # When I run the retrieve and build loop
    packages = installer.retrieve_and_build()

    # Than I see that the package was retrieved
    packages.should.equal(set(["gherkin"]))

    # And I clean the mess
    index.delete()
開發者ID:qrees,項目名稱:curdling,代碼行數:24,代碼來源:test_main.py

示例7: test_downloader

# 需要導入模塊: from curdling.index import Index [as 別名]
# 或者: from curdling.index.Index import delete [as 別名]
def test_downloader():
    "It should be possible to download packages from pip repos"

    # Given that I have a finder pointing to our local pypi server
    finder = Finder(**{
        'conf': {'pypi_urls': ['http://localhost:8000/simple']},
    })

    # And a downloader pointing to a temporary index
    index = Index(FIXTURE('tmpindex'))
    downloader = Downloader(**{'index': index})

    # When I find the link
    link = finder.handle('tests', {'requirement': 'gherkin (== 0.1.0)'})

    # And When I try to retrieve a package from it
    downloader.handle('main', link)

    # Then I see that the package was downloaded correctly to the storage
    index.get('gherkin==0.1.0').should_not.be.empty

    # And I cleanup the mess
    index.delete()
開發者ID:harobed,項目名稱:curdling,代碼行數:25,代碼來源:test_main.py


注:本文中的curdling.index.Index.delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。