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', ))
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", ))
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
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