<s> import testlib <EOL> try : <EOL> import unittest <EOL> except ImportError : <EOL> import unittest2 as unittest <EOL> import splunklib . client as client <EOL> class ModularInputKindTestCase ( testlib . SDKTestCase ) : <EOL> def setUp ( self ) : <EOL> super ( ModularInputKindTestCase , self ) . setUp ( ) <EOL> self . uncheckedRestartSplunk ( ) <EOL> def test_list_arguments ( self ) : <EOL> if not self . app_collection_installed ( ) : <EOL> print "<STR_LIT>" <EOL> return <EOL> self . install_app_from_collection ( "<STR_LIT>" ) <EOL> if self . service . splunk_version [ <NUM_LIT:0> ] < <NUM_LIT:5> : <EOL> return <EOL> test1 = self . service . modular_input_kinds [ '<STR_LIT>' ] <EOL> expected_args = set ( [ "<STR_LIT:name>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> found_args = set ( test1 . arguments . keys ( ) ) <EOL> self . assertEqual ( expected_args , found_args ) <EOL> def test_update_raises_exception ( self ) : <EOL> if not self . app_collection_installed ( ) : <EOL> print "<STR_LIT>" <EOL> return <EOL> self . install_app_from_collection ( "<STR_LIT>" ) <EOL> if self . service . splunk_version [ <NUM_LIT:0> ] < <NUM_LIT:5> : <EOL> return <EOL> test1 = self . service . modular_input_kinds [ '<STR_LIT>' ] <EOL> self . assertRaises ( client . IllegalOperationException , test1 . update , a = "<STR_LIT:b>" ) <EOL> def check_modular_input_kind ( self , m ) : <EOL> if m . name == '<STR_LIT>' : <EOL> self . assertEqual ( '<STR_LIT>' , m [ '<STR_LIT:title>' ] ) <EOL> self . assertEqual ( "<STR_LIT>" , m [ '<STR_LIT>' ] ) <EOL> elif m . name == '<STR_LIT>' : <EOL> self . assertEqual ( '<STR_LIT>' , m [ '<STR_LIT:title>' ] ) <EOL> self . assertEqual ( '<STR_LIT>' , m [ '<STR_LIT>' ] ) <EOL> def test_list_modular_inputs ( self ) : <EOL> if not self . app_collection_installed ( ) : <EOL> print "<STR_LIT>" <EOL> return <EOL> self . install_app_from_collection ( "<STR_LIT>" ) <EOL> if self . service . splunk_version [ <NUM_LIT:0> ] < <NUM_LIT:5> : <EOL> return <EOL> for m in self . service . modular_input_kinds : <EOL> self . check_modular_input_kind ( m ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> try : <EOL> import unittest2 as unittest <EOL> except ImportError : <EOL> import unittest <EOL> unittest . main ( ) </s>
