Beispiel #1
0
def test_update_package(monkeypatch):
    """Test generating an update command for a package."""
    monkeypatch.setattr(manage, 'call', Mock())
    pkg = PkgFile('mypkg', '1.0', replaces=PkgFile('mypkg', '0.9'))
    update_package(pkg, '.')
    manage.call.assert_called_once_with((  # pylint: disable=no-member
        'pip',
        '-q',
        'download',
        '--no-deps',
        '-i',
        'https://pypi.org/simple',
        '-d',
        '.',
        'mypkg==1.0',
    ))
Beispiel #2
0
def test_update_package(monkeypatch):
    """Test generating an update command for a package."""
    monkeypatch.setattr(manage, "call", Mock())
    pkg = PkgFile("mypkg", "1.0", replaces=PkgFile("mypkg", "0.9"))
    update_package(pkg, ".")
    manage.call.assert_called_once_with((  # pylint: disable=no-member
        "pip",
        "-q",
        "download",
        "--no-deps",
        "-i",
        "https://pypi.org/simple",
        "-d",
        ".",
        "mypkg==1.0",
    ))
Beispiel #3
0
def test_update_package_dry_run(monkeypatch):
    """Test generating an update command for a package."""
    monkeypatch.setattr(manage, 'call', Mock())
    pkg = PkgFile('mypkg', '1.0', replaces=PkgFile('mypkg', '0.9'))
    update_package(pkg, '.', dry_run=True)
    assert not manage.call.mock_calls  # pylint: disable=no-member
Beispiel #4
0
def test_update_package_dry_run(monkeypatch):
    """Test generating an update command for a package."""
    monkeypatch.setattr(manage, "call", Mock())
    pkg = PkgFile("mypkg", "1.0", replaces=PkgFile("mypkg", "0.9"))
    update_package(pkg, ".", dry_run=True)
    assert not manage.call.mock_calls  # pylint: disable=no-member