<s> """<STR_LIT>""" <EOL> from . import TestCase <EOL> import tempfile <EOL> from JsonStats . FetchStats import Fetcher <EOL> from JsonStats . Utils import load_extra_plugins <EOL> import shutil <EOL> class TestLoadExtraPlugins ( TestCase ) : <EOL> import os <EOL> import os . path <EOL> def setUp ( self ) : <EOL> self . _extra_dir = tempfile . mkdtemp ( '<STR_LIT>' ) <EOL> self . _extra_plugin = self . os . path . join ( self . _extra_dir , '<STR_LIT>' ) <EOL> self . _extra_dir2 = tempfile . mkdtemp ( '<STR_LIT>' ) <EOL> self . _extra_plugin2 = self . os . path . join ( self . _extra_dir2 , '<STR_LIT>' ) <EOL> self . _extra_plugin_dirs = ( self . _extra_dir , self . _extra_dir2 ) <EOL> shutil . copy ( '<STR_LIT>' , self . _extra_plugin ) <EOL> shutil . copy ( '<STR_LIT>' , self . _extra_plugin2 ) <EOL> def test_load_extra_plugins ( self ) : <EOL> """<STR_LIT>""" <EOL> loaded = load_extra_plugins ( self . _extra_dir ) <EOL> total_loaded = len ( loaded ) <EOL> self . assertEqual ( total_loaded , <NUM_LIT:1> , msg = "<STR_LIT>" % ( total_loaded , '<STR_LIT:U+002CU+0020>' . join ( loaded ) ) ) <EOL> def test_load_compound_path ( self ) : <EOL> """<STR_LIT>""" <EOL> compound_pathspec = "<STR_LIT>" % self . _extra_plugin_dirs <EOL> loaded = load_extra_plugins ( compound_pathspec ) <EOL> total_loaded = len ( loaded ) <EOL> self . assertEqual ( total_loaded , <NUM_LIT:2> , msg = "<STR_LIT>" % ( total_loaded , '<STR_LIT:U+002CU+0020>' . join ( loaded ) ) ) <EOL> def tearDown ( self ) : <EOL> for d in self . _extra_plugin_dirs : <EOL> for f in self . os . listdir ( d ) : <EOL> ff = self . os . path . join ( d , f ) <EOL> self . os . remove ( ff ) <EOL> self . os . rmdir ( d ) </s>
