<s> from sahara . plugins . cdh import abstractversionhandler as avh <EOL> from sahara . plugins . cdh import versionfactory as vf <EOL> from sahara . tests . unit import base <EOL> class VersionFactoryTestCase ( base . SaharaTestCase ) : <EOL> def test_get_instance ( self ) : <EOL> self . assertFalse ( vf . VersionFactory . initialized ) <EOL> factory = vf . VersionFactory . get_instance ( ) <EOL> self . assertIsInstance ( factory , vf . VersionFactory ) <EOL> self . assertTrue ( vf . VersionFactory . initialized ) <EOL> def test_get_versions ( self ) : <EOL> factory = vf . VersionFactory . get_instance ( ) <EOL> versions = factory . get_versions ( ) <EOL> expected_versions = self . get_support_versions ( ) <EOL> self . assertEqual ( expected_versions , versions ) <EOL> def test_get_version_handler ( self ) : <EOL> factory = vf . VersionFactory . get_instance ( ) <EOL> versions = self . get_support_versions ( ) <EOL> for version in versions : <EOL> hander = factory . get_version_handler ( version ) <EOL> self . assertIsInstance ( hander , avh . AbstractVersionHandler ) <EOL> def get_support_versions ( self ) : <EOL> return [ '<STR_LIT:5>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] </s>
