runcible 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,7 +14,7 @@ require 'minitest/unit'
14
14
  require 'minitest/autorun'
15
15
 
16
16
  require 'test/integration/vcr_setup'
17
- require 'lib/runcible/base'
17
+ require './lib/runcible/base'
18
18
 
19
19
 
20
20
  class CustomMiniTestRunner
@@ -55,7 +55,7 @@ class PulpMiniTestRunner
55
55
  def run_tests(options={})
56
56
  mode = options[:mode] || "recorded"
57
57
  test_name = options[:test_name] || nil
58
- auth_type = options[:auth_type] || "basic"
58
+ auth_type = options[:auth_type] || "http"
59
59
 
60
60
  MiniTest::Unit.runner = CustomMiniTestRunner::Unit.new
61
61
 
@@ -71,22 +71,28 @@ class PulpMiniTestRunner
71
71
  end
72
72
 
73
73
  def set_runcible_config(auth_type)
74
- if auth_type == "basic"
75
- Runcible::Base.config = {}
74
+ if auth_type == "http"
75
+ Runcible::Base.config = {
76
+ :api_path => "/pulp/api/v2/",
77
+ :http_auth => {}
78
+ }
76
79
 
77
80
  File.open('/etc/pulp/server.conf') do |f|
78
81
  f.each_line do |line|
79
82
  if line.start_with?('default_password')
80
- Runcible::Base.config[:password] = line.split(':')[1].strip
83
+ Runcible::Base.config[:http_auth][:password] = line.split(':')[1].strip
81
84
  elsif line.start_with?('default_login')
82
85
  Runcible::Base.config[:user] = line.split(':')[1].strip
83
86
  elsif line.start_with?('server_name')
84
- Runcible::Base.config[:url] = 'https://' + line.split(':')[1].chomp.strip
87
+ Runcible::Base.config[:url] = "https://#{line.split(':')[1].chomp.strip}"
85
88
  end
86
89
  end
87
90
  end
88
91
  elsif auth_type == "oauth"
89
- Runcible::Base.config = { :oauth => {} }
92
+ Runcible::Base.config = {
93
+ :api_path => "/pulp/api/v2/",
94
+ :oauth => {}
95
+ }
90
96
 
91
97
  File.open('/etc/pulp/server.conf') do |f|
92
98
  f.each_line do |line|
@@ -94,8 +100,10 @@ class PulpMiniTestRunner
94
100
  Runcible::Base.config[:oauth][:oauth_secret] = line.split(':')[1].strip
95
101
  elsif line.start_with?('oauth_key')
96
102
  Runcible::Base.config[:oauth][:oauth_key] = line.split(':')[1].strip
103
+ elsif line.start_with?('default_login')
104
+ Runcible::Base.config[:user] = line.split(':')[1].strip
97
105
  elsif line.start_with?('server_name')
98
- Runcible::Base.config[:url] = 'https://' + line.split(':')[1].chomp.strip
106
+ Runcible::Base.config[:url] = "https://#{line.split(':')[1].chomp.strip}"
99
107
  end
100
108
  end
101
109
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runcible
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Eric D Helms