This repository has been archived by the owner on Oct 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with underscores in package names. Fixes #91
Before this commit, `python_pip` reinstalled packages that contain underscores in their names. More details at #91
- Loading branch information
Showing
4 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
test/cookbooks/python_test/files/default/tests/minitest/test_pip_test.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'minitest/spec' | ||
|
||
describe_recipe 'python_test::test_pip' do | ||
include MiniTest::Chef::Assertions | ||
include MiniTest::Chef::Context | ||
include MiniTest::Chef::Resources | ||
|
||
it "ran first should_dsl pip install" do | ||
assert File.exist?("/tmp/first-install.txt"), `/tmp/virtualenv/bin/pip freeze` | ||
end | ||
|
||
it "did not run second should_dsl pip install" do | ||
assert !File.exist?("/tmp/second-install.txt"), `/tmp/virtualenv/bin/pip freeze` | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# | ||
# Author:: Hugo Lopes Tavares <[email protected]> | ||
# Cookbook Name:: python | ||
# Recipe:: test_virtualenv | ||
# | ||
# Copyright 2013, Heavy Water Operations, LLC. | ||
# Copyright 2014, Yipit, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
file "/tmp/first-install.txt" do | ||
content "test" | ||
action :nothing | ||
end | ||
|
||
file "/tmp/second-install.txt" do | ||
content "test" | ||
action :nothing | ||
end | ||
|
||
python_virtualenv "/tmp/virtualenv" do | ||
owner "root" | ||
group "root" | ||
action :create | ||
end | ||
|
||
python_pip "should_dsl first install" do | ||
package_name "should_dsl" | ||
virtualenv "/tmp/virtualenv" | ||
version "2.1.2" | ||
notifies :create, "file[/tmp/first-install.txt]" | ||
end | ||
|
||
python_pip "should_dsl second install" do | ||
package_name "should_dsl" | ||
virtualenv "/tmp/virtualenv" | ||
# same version as before | ||
version "2.1.2" | ||
notifies :create, "file[/tmp/second-install.txt]" | ||
end |