class ModularInputKindsTestCase

Public Instance Methods

setup() click to toggle source
Calls superclass method TestCaseWithSplunkConnection#setup
# File test/test_modular_input_kinds.rb, line 7
def setup
  super

  omit_if(@service.splunk_version[0] < 5)
  if not has_test_data?(@service)
    fail("Install the SDK test data to test modular input kinds.")
  end
  install_app_from_collection("modular-inputs")
end
test_list_arguments() click to toggle source

Does the argument method on ModularInputKind return the expected keys on a known modular input kind?

# File test/test_modular_input_kinds.rb, line 21
def test_list_arguments
  test1 = @service.modular_input_kinds["test1"]
  expected_args = ["name", "resname", "key_id", "no_description",
                   "empty_description", "arg_required_on_edit",
                   "not_required_on_edit", "required_on_create",
                   "not_required_on_create", "number_field",
                   "string_field", "boolean_field"].sort()
  found_args = test1.arguments.keys().sort()
  assert_equal(expected_args, found_args)
end
test_list_modular_inputs_and_headers() click to toggle source

Does each iterate properly? Are the headers of the modular inputs sane?

# File test/test_modular_input_kinds.rb, line 35
def test_list_modular_inputs_and_headers
  @service.modular_input_kinds.each do |mod_input|
    if mod_input.name == "test1"
      assert_equal('Test "Input" - 1', mod_input["title"])
      assert_equal("xml", mod_input["streaming_mode"])
    elsif mod_input.name == "test2"
      assert_equal("test2", mod_input["title"])
      assert_equal("simple", mod_input["streaming_mode"])
    end
  end
end