Revision 3061c66a
Added by Thomas McKay over 6 years ago
test/resources/subscriptions_test.rb | ||
---|---|---|
43 | 43 |
stdout,stderr = capture { |
44 | 44 |
hammer.run(%W{--reload-cache csv subscriptions --verbose --file #{file.path}}) |
45 | 45 |
} |
46 |
assert_equal '', stdout
|
|
46 |
assert_equal "Importing manifest './test/data/doesnotexist.zip' into organization 'Test Corporation'...done\n", stdout
|
|
47 | 47 |
lines = stderr.split("\n") |
48 | 48 |
assert_equal "Manifest upload failed:", lines[0] |
49 | 49 |
assert_match(/.*Error: No such file or directory.*/, lines[1]) |
... | ... | |
88 | 88 |
file = Tempfile.new('subscriptions_test') |
89 | 89 |
# rubocop:disable LineLength |
90 | 90 |
file.write <<-FILE |
91 |
Name,Organization,Manifest File,Subscription Name,Quantity,Product SKU,Contract Number,Account Number
|
|
91 |
Name,Organization,Manifest File,Subscription Name,Subscription Quantity,Subscription SKU,Subscription Contract,Subscription Account
|
|
92 | 92 |
Manifest,Test Corporation,#{manifestfile.path} |
93 | 93 |
Manifest Name,Test Corporation,TestCorp |
94 | 94 |
Manifest URL,Test Corporation,https://access.stage.redhat.com/management/distributors/1234 |
... | ... | |
102 | 102 |
--in-portal --portal-username #{username} --portal-password #{password} |
103 | 103 |
--portal https://subscription.rhn.stage.redhat.com:443}) |
104 | 104 |
} |
105 |
assert_equal stderr, '' |
|
106 |
assert_equal stdout, <<-OUTPUT |
|
107 |
Checking manifest 'TestCorp'...done |
|
108 |
'Red Hat Enterprise Linux Server, Standard (Physical or Virtual Nodes)' of quantity 200 already attached |
|
109 |
Downloading manifest for organization 'Test Corporation...writing to file '#{manifestfile.path}'...done |
|
110 |
OUTPUT |
|
105 |
lines = stdout.split("\n") |
|
106 |
assert_equal "Checking manifest 'TestCorp'...done", lines[0] |
|
107 |
assert_equal "'Red Hat Enterprise Linux Server, Standard (Physical or Virtual Nodes)' of quantity 200 already attached", lines[1] |
|
108 |
assert_equal "Downloading manifest for organization 'Test Corporation...writing to file '#{manifestfile.path}'...done", lines[2] |
|
109 |
assert_equal "Importing manifest '#{manifestfile.path}' into organization 'Test Corporation'...done", lines[3] |
|
111 | 110 |
file.unlink |
112 | 111 |
manifestfile.unlink |
113 | 112 |
stop_vcr |
Also available in: Unified diff
fixes #____ - subscriptions manifest, dates