deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [3/50] [abbrv] git commit: EC2: Moved credentials from tests to common.rb
Date Mon, 30 Jul 2012 14:29:16 GMT
EC2: Moved credentials from tests to common.rb


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/1ed49681
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/1ed49681
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/1ed49681

Branch: refs/heads/master
Commit: 1ed49681482d64fb1578fc6ab6989e32d7cc8cc2
Parents: 46605b0
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Mon Jul 30 13:13:53 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Mon Jul 30 16:25:00 2012 +0200

----------------------------------------------------------------------
 server/tests/drivers/ec2/common.rb        |   11 +++++++++--
 server/tests/drivers/ec2/images_test.rb   |    2 +-
 server/tests/drivers/ec2/instance_test.rb |   16 ++++++++--------
 server/tests/drivers/ec2/keys_test.rb     |    2 +-
 server/tests/drivers/ec2/realms_test.rb   |    2 +-
 5 files changed, 20 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/1ed49681/server/tests/drivers/ec2/common.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/ec2/common.rb b/server/tests/drivers/ec2/common.rb
index a40a8bc..c7a8249 100644
--- a/server/tests/drivers/ec2/common.rb
+++ b/server/tests/drivers/ec2/common.rb
@@ -9,12 +9,19 @@ require 'vcr'
 # NOTE: This timestamp need to be changed when re-recording
 #       the fixtures.
 
-Time.be(DateTime.parse("2012-07-23 12:21:00 +0000").to_s)
+def credentials
+  {
+    :user => 'AKIAJYOQYLLOIWN5LQ3A',
+    :password => 'Ra2ViYaYgocAJqPAQHxMVU/l2sGGU2pifmWT4q3H'
+  }
+end
+
+Time.be(DateTime.parse("2012-07-30 11:05:00 +0000").to_s)
 
 VCR.configure do |c|
   # NOTE: Empty this directory before re-recording
   c.cassette_library_dir = File.join(File.dirname(__FILE__), 'fixtures')
   c.hook_into :webmock
   # Set this to :new_episodes when you want to 're-record'
-  c.default_cassette_options = { :record => :none }
+  c.default_cassette_options = { :record => :new_episodes }
 end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/1ed49681/server/tests/drivers/ec2/images_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/ec2/images_test.rb b/server/tests/drivers/ec2/images_test.rb
index 67220d2..ea864cd 100644
--- a/server/tests/drivers/ec2/images_test.rb
+++ b/server/tests/drivers/ec2/images_test.rb
@@ -6,7 +6,7 @@ require_relative 'common.rb'
 describe 'Ec2Driver Images' do
 
   before do
-    @driver = Deltacloud::new(:ec2, :user => 'AKIAIZ63KHGXIWDMBY6Q', :password => 'zUfBCbML2S6pXKS44eEEXw0Cf/G8z9hMSxP2hcLV')
+    @driver = Deltacloud::new(:ec2, credentials)
     VCR.insert_cassette __name__
   end
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/1ed49681/server/tests/drivers/ec2/instance_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/ec2/instance_test.rb b/server/tests/drivers/ec2/instance_test.rb
index 38ecf3e..c14afd9 100644
--- a/server/tests/drivers/ec2/instance_test.rb
+++ b/server/tests/drivers/ec2/instance_test.rb
@@ -6,7 +6,7 @@ require_relative 'common.rb'
 describe 'Ec2Driver Instances' do
 
   before do
-    @driver = Deltacloud::new(:ec2, :user => 'AKIAIZ63KHGXIWDMBY6Q', :password => 'zUfBCbML2S6pXKS44eEEXw0Cf/G8z9hMSxP2hcLV')
+    @driver = Deltacloud::new(:ec2, credentials)
     VCR.insert_cassette __name__
   end
 
@@ -26,10 +26,10 @@ describe 'Ec2Driver Instances' do
   end
 
   it 'must allow to filter instances' do
-    @driver.instances(:id => 'i-4cdcf034').wont_be_empty
-    @driver.instances(:id => 'i-4cdcf034').must_be_kind_of Array
-    @driver.instances(:id => 'i-4cdcf034').size.must_equal 1
-    @driver.instances(:id => 'i-4cdcf034').first.id.must_equal 'i-4cdcf034'
+    @driver.instances(:id => 'i-4d15f036').wont_be_empty
+    @driver.instances(:id => 'i-4d15f036').must_be_kind_of Array
+    @driver.instances(:id => 'i-4d15f036').size.must_equal 1
+    @driver.instances(:id => 'i-4d15f036').first.id.must_equal 'i-4d15f036'
     @driver.instances(:owner_id => '293787749884').wont_be_empty
     @driver.instances(:owner_id => '293787749884').each do |inst|
       inst.owner_id.must_equal '293787749884'
@@ -39,9 +39,9 @@ describe 'Ec2Driver Instances' do
   end
 
   it 'must allow to retrieve single instance' do
-    @driver.instance(:id => 'i-4cdcf034').wont_be_nil
-    @driver.instance(:id => 'i-4cdcf034').must_be_kind_of Instance
-    @driver.instance(:id => 'i-4cdcf034').id.must_equal 'i-4cdcf034'
+    @driver.instance(:id => 'i-4d15f036').wont_be_nil
+    @driver.instance(:id => 'i-4d15f036').must_be_kind_of Instance
+    @driver.instance(:id => 'i-4d15f036').id.must_equal 'i-4d15f036'
     @driver.instance(:id => 'i-00000000').must_be_nil
     @driver.instance(:id => 'unknown').must_be_nil
   end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/1ed49681/server/tests/drivers/ec2/keys_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/ec2/keys_test.rb b/server/tests/drivers/ec2/keys_test.rb
index bc29fd4..936c907 100644
--- a/server/tests/drivers/ec2/keys_test.rb
+++ b/server/tests/drivers/ec2/keys_test.rb
@@ -6,7 +6,7 @@ require_relative 'common.rb'
 describe 'Ec2Driver Instances' do
 
   before do
-    @driver = Deltacloud::new(:ec2, :user => 'AKIAIZ63KHGXIWDMBY6Q', :password => 'zUfBCbML2S6pXKS44eEEXw0Cf/G8z9hMSxP2hcLV')
+    @driver = Deltacloud::new(:ec2, credentials)
     VCR.insert_cassette __name__
   end
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/1ed49681/server/tests/drivers/ec2/realms_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/ec2/realms_test.rb b/server/tests/drivers/ec2/realms_test.rb
index f83ca44..e3e60fb 100644
--- a/server/tests/drivers/ec2/realms_test.rb
+++ b/server/tests/drivers/ec2/realms_test.rb
@@ -6,7 +6,7 @@ require_relative 'common.rb'
 describe 'Ec2Driver Realms' do
 
   before do
-    @driver = Deltacloud::new(:ec2, :user => 'AKIAIZ63KHGXIWDMBY6Q', :password => 'zUfBCbML2S6pXKS44eEEXw0Cf/G8z9hMSxP2hcLV')
+    @driver = Deltacloud::new(:ec2, credentials)
     VCR.insert_cassette __name__
   end
 


Mime
View raw message