#NEWLINE# def test_package_spec( self ) : #NEWLINE# #INDENT# cls = images . SaharaPackageValidator #NEWLINE# validator = cls . from_spec ( 'java' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , [ ] ) #NEWLINE# self . assertIsInstance ( validator , cls ) #NEWLINE# self . assertEqual ( str ( validator . packages [ 0 ] ) , 'java' ) #NEWLINE# validator = cls . from_spec ( { #NEWLINE# #INDENT# 'java' : { #NEWLINE# #INDENT# 'version' : '8' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , [ ] ) #NEWLINE# self . assertIsInstance ( validator , cls ) #NEWLINE# self . assertEqual ( str ( validator . packages [ 0 ] ) , 'java-8' ) #NEWLINE# validator = cls . from_spec ( [ { #NEWLINE# #INDENT# 'java' : { #NEWLINE# #INDENT# 'version' : '8' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , 'hadoop' ] , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , [ ] ) #NEWLINE# self . assertIsInstance ( validator , cls ) #NEWLINE# self . assertEqual ( str ( validator . packages [ 0 ] ) , 'java-8' ) #NEWLINE# self . assertEqual ( str ( validator . packages [ 1 ] ) , 'hadoop' )