Revision 3fe1ff94
Added by Thomas McKay almost 8 years ago
test/resources/settings_test.rb | ||
---|---|---|
csv settings [OPTIONS]
|
||
|
||
Options:
|
||
--continue-on-error Continue processing even if individual resource error
|
||
--export Export current data instead of importing
|
||
--file FILE_NAME CSV file (default to /dev/stdout with --export, otherwise required)
|
||
--organization ORGANIZATION Only process organization matching this name
|
||
... | ... | |
file.unlink
|
||
stop_vcr
|
||
end
|
||
|
||
def test_update_settings_continue
|
||
start_vcr
|
||
set_user 'admin'
|
||
|
||
name = "settings#{rand(10000)}"
|
||
|
||
file = Tempfile.new('settings_test')
|
||
# rubocop:disable LineLength
|
||
file.write <<-FILE
|
||
Name,Count,Value
|
||
badsetting,1,1234
|
||
idle_timeout,1,60000
|
||
FILE
|
||
file.rewind
|
||
|
||
stdout,stderr = capture {
|
||
hammer.run(%W{csv settings --verbose --continue-on-error --file #{file.path}})
|
||
}
|
||
stderr.must_equal "Error: Setting 'badsetting' not found\nbadsetting,1,1234\n"
|
||
lines = stdout.split("\n")
|
||
assert_equal lines[0], "Updating setting 'idle_timeout'...done"
|
||
file.unlink
|
||
stop_vcr
|
||
end
|
||
end
|
||
|
||
end
|
Also available in: Unified diff
fixes #15752 - continue processing even if error