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


Python Index.scan方法代碼示例

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


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

示例1: test_curd_package

# 需要導入模塊: from curdling.index import Index [as 別名]
# 或者: from curdling.index.Index import scan [as 別名]
def test_curd_package():
    "It should possible to convert regular packages to wheels"

    # Given that I have a storage containing a package
    index = Index(FIXTURE('storage1'))
    index.scan()

    # And a curdling using that index
    curdling = Curdling(index=index)

    # When I request a curd to be created
    package = curdling.wheel('gherkin==0.1.0', ('main', {
        'path': index.get('gherkin==0.1.0;~whl')}))

    # Then I see it's a wheel package.
    package.should.equal({
        'path': FIXTURE('storage1/gherkin-0.1.0-py27-none-any.whl'),
    })

    # And that it's present in the index
    package = index.get('gherkin==0.1.0;whl')

    # And that the file was created in the file system
    os.path.exists(package).should.be.true

    # And I delete the file
    os.unlink(package)
開發者ID:pombredanne,項目名稱:curdling,代碼行數:29,代碼來源:test_main.py

示例2: test_curd_package

# 需要導入模塊: from curdling.index import Index [as 別名]
# 或者: from curdling.index.Index import scan [as 別名]
def test_curd_package():
    "It should possible to convert regular packages to wheels"

    # Given that I have a storage containing a package
    index = Index(FIXTURE('storage1'))
    index.scan()

    # And a curdling using that index
    curdling = Curdler(**{'index': index})

    # When I request a curd to be created
    package = curdling.handle('main', {
        'tarball': index.get('gherkin==0.1.0;~whl'),
        'requirement': 'gherkin (0.1.0)',
    })

    # Then I see it's a wheel package.
    package['wheel'].should.match(
        FIXTURE('storage1/gherkin-0.1.0-py\d{2}-none-any.whl'))

    # And that it's present in the index
    package = index.get('gherkin==0.1.0;whl')

    # And that the file was created in the file system
    os.path.exists(package).should.be.true

    # And I delete the file
    os.unlink(package)
開發者ID:harobed,項目名稱:curdling,代碼行數:30,代碼來源:test_main.py

示例3: test_index_scan_when_there_is_no_dir

# 需要導入模塊: from curdling.index import Index [as 別名]
# 或者: from curdling.index.Index import scan [as 別名]
def test_index_scan_when_there_is_no_dir():
    "Index.scan() should not fail when the dir does not exist"

    # Given that I have an index that points to a directory that already
    # contains packages
    index = Index('I know this directory does not exist')

    # When I scan the directory, I see it does not fail
    index.scan()
開發者ID:pombredanne,項目名稱:curdling,代碼行數:11,代碼來源:test_index.py

示例4: test_index_scan

# 需要導入模塊: from curdling.index import Index [as 別名]
# 或者: from curdling.index.Index import scan [as 別名]
def test_index_scan():
    "It should be possible to scan for already existing folders"

    # Given that I have an index that points to a folder that already contains
    # packages
    index = Index(FIXTURE('storage1'))

    # When I scan the directory
    index.scan()

    # Then I can look for packages
    index.get('gherkin==0.1.0').should.equal(
        FIXTURE('storage1/gherkin-0.1.0.tar.gz'),
    )
開發者ID:pombredanne,項目名稱:curdling,代碼行數:16,代碼來源:test_index.py

示例5: test_install_package

# 需要導入模塊: from curdling.index import Index [as 別名]
# 或者: from curdling.index.Index import scan [as 別名]
def test_install_package():
    "It should possible to install wheels"

    # Given that I have an installer configured with a loaded index
    index = Index(FIXTURE("storage2"))
    index.scan()
    installer = Installer(**{"index": index})

    # When I request a curd to be created
    installer.handle("main", {"requirement": "gherkin==0.1.0", "wheel": index.get("gherkin==0.1.0;whl")})

    # Then I see that the package was installed
    Database.check_installed("gherkin==0.1.0").should.be.true

    # And I uninstall the package
    Database.uninstall("gherkin==0.1.0")
開發者ID:qrees,項目名稱:curdling,代碼行數:18,代碼來源:test_main.py

示例6: test_install_package

# 需要導入模塊: from curdling.index import Index [as 別名]
# 或者: from curdling.index.Index import scan [as 別名]
def test_install_package():
    "It should possible to install wheels"

    # Given that I have an installer configured with a loaded index
    index = Index(FIXTURE('storage2'))
    index.scan()
    installer = Installer(index=index)

    # When I request a curd to be created
    installer.install('gherkin==0.1.0', ('main', {
        'path': index.get('gherkin==0.1.0;whl')}))

    # Then I see that the package was installed
    Env({}).check_installed('gherkin==0.1.0').should.be.true

    # And I uninstall the package
    Env({}).uninstall('gherkin==0.1.0')
開發者ID:pombredanne,項目名稱:curdling,代碼行數:19,代碼來源:test_main.py

示例7: test_install_package

# 需要導入模塊: from curdling.index import Index [as 別名]
# 或者: from curdling.index.Index import scan [as 別名]
def test_install_package():
    "It should possible to install wheels"

    # Given that I have an installer configured with a loaded index
    index = Index(FIXTURE('storage2'))
    index.scan()
    installer = Installer(**{'index': index})

    # When I request a curd to be created
    installer.handle('main', {
        'requirement': 'gherkin==0.1.0',
        'wheel': index.get('gherkin==0.1.0;whl'),
    })

    # Then I see that the package was installed
    Database.check_installed('gherkin==0.1.0').should.be.true

    # And I uninstall the package
    Database.uninstall('gherkin==0.1.0')
開發者ID:harobed,項目名稱:curdling,代碼行數:21,代碼來源:test_main.py


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