File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -2432,15 +2432,12 @@ def kindpath(self, kind):
24322432 :return: The relative endpoint path.
24332433 :rtype: ``string``
24342434 """
2435- if kind in self .kinds :
2436- return UrlEncoded (kind , skip_encode = True )
2437- # Special cases
2438- elif kind == 'tcp' :
2435+ if kind == 'tcp' :
24392436 return UrlEncoded ('tcp/raw' , skip_encode = True )
24402437 elif kind == 'splunktcp' :
24412438 return UrlEncoded ('tcp/cooked' , skip_encode = True )
24422439 else :
2443- raise ValueError ( "No such kind on server: %s" % kind )
2440+ return UrlEncoded ( kind , skip_encode = True )
24442441
24452442 def list (self , * kinds , ** kwargs ):
24462443 """Returns a list of inputs that are in the :class:`Inputs` collection.
Original file line number Diff line number Diff line change @@ -131,6 +131,14 @@ def test_read_kind(self):
131131 def test_inputs_list_on_one_kind (self ):
132132 self .service .inputs .list ('monitor' )
133133
134+ def test_read_invalid_input (self ):
135+ name = testlib .tmpname ()
136+ try :
137+ self .service .inputs .get (name )
138+ self .fail ("Expected a 404 HTTPError" )
139+ except HTTPError as he :
140+ self .assertTrue ("HTTP 404 Not Found" in str (he ))
141+
134142 def test_inputs_list_on_one_kind_with_count (self ):
135143 N = 10
136144 expected = [x .name for x in self .service .inputs .list ('monitor' )[:10 ]]
You can’t perform that action at this time.
0 commit comments