예제 #1
0
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': [DUMMY_PYPI]
        },
    })
    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()
예제 #2
0
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': [DUMMY_PYPI]
        },
    })
    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()
예제 #3
0
파일: test_main.py 프로젝트: qrees/curdling
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()
예제 #4
0
def test_pipeline_dependencer_queue():
    "Install#pipeline() should route all the requirements from the dependencer to Install#handle()"

    # Given that I have the install command
    index = Index('')
    index.storage = {}
    install = Install(conf={'index': index})

    # And I mock the curdler service end-point and start all the services
    install.queue = Mock(__name__=str('handle'))
    install.pipeline()

    # When I fire the download.finished() signal with proper data
    install.dependencer.emit('dependency_found', 'dependencer', requirement='curdling (0.3.0)')

    # Than I see that the curdler received a request
    install.queue.assert_called_once_with(
        'dependencer', requirement='curdling (0.3.0)')