<s> from __future__ import absolute_import <EOL> import re <EOL> from salttesting . helpers import ensure_in_syspath <EOL> ensure_in_syspath ( '<STR_LIT>' ) <EOL> import integration <EOL> import salt . ext . six as six <EOL> class SysModuleTest ( integration . ModuleCase ) : <EOL> '''<STR_LIT>''' <EOL> def test_list_functions ( self ) : <EOL> '''<STR_LIT>''' <EOL> funcs = self . run_function ( '<STR_LIT>' ) <EOL> self . assertIn ( '<STR_LIT>' , funcs ) <EOL> self . assertIn ( '<STR_LIT>' , funcs ) <EOL> funcs = self . run_function ( '<STR_LIT>' , ( '<STR_LIT>' , ) ) <EOL> self . assertNotIn ( '<STR_LIT>' , funcs ) <EOL> self . assertIn ( '<STR_LIT>' , funcs ) <EOL> funcs = self . run_function ( '<STR_LIT>' , ( '<STR_LIT>' , ) ) <EOL> self . assertNotIn ( '<STR_LIT>' , funcs ) <EOL> self . assertIn ( '<STR_LIT>' , funcs ) <EOL> funcs = self . run_function ( '<STR_LIT>' , ( '<STR_LIT>' , ) ) <EOL> self . assertNotIn ( '<STR_LIT>' , funcs ) <EOL> self . assertIn ( '<STR_LIT>' , funcs ) <EOL> def test_list_modules ( self ) : <EOL> '''<STR_LIT>''' <EOL> mods = self . run_function ( '<STR_LIT>' ) <EOL> self . assertTrue ( '<STR_LIT>' in mods ) <EOL> self . assertTrue ( '<STR_LIT>' in mods ) <EOL> def test_valid_docs ( self ) : <EOL> '''<STR_LIT>''' <EOL> docs = self . run_function ( '<STR_LIT>' ) <EOL> nodoc = set ( ) <EOL> noexample = set ( ) <EOL> allow_failure = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> for fun in docs : <EOL> if fun . startswith ( '<STR_LIT>' ) : <EOL> continue <EOL> if fun in allow_failure : <EOL> continue <EOL> if not isinstance ( docs [ fun ] , six . string_types ) : <EOL> nodoc . add ( fun ) <EOL> elif not re . search ( r'<STR_LIT>' , docs [ fun ] ) : <EOL> noexample . add ( fun ) <EOL> if not nodoc and not noexample : <EOL> return <EOL> raise AssertionError ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' . format ( <EOL> '<STR_LIT:\n>' . join ( [ '<STR_LIT>' . format ( f ) for f in sorted ( nodoc ) ] ) , <EOL> '<STR_LIT:\n>' . join ( [ '<STR_LIT>' . format ( f ) for f in sorted ( noexample ) ] ) , <EOL> ) <EOL> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> from integration import run_tests <EOL> run_tests ( SysModuleTest ) </s>
