#NEWLINE# def test_block_device( self ) : #NEWLINE# #INDENT# swap = { #NEWLINE# #INDENT# 'device_name' : '/dev/sdb' , #NEWLINE# 'swap_size' : 1 , #NEWLINE# #UNINDENT# } #NEWLINE# ephemerals = [ { #NEWLINE# #INDENT# 'num' : 0 , #NEWLINE# 'virtual_name' : 'ephemeral0' , #NEWLINE# 'device_name' : '/dev/sdc1' , #NEWLINE# 'size' : 1 , #NEWLINE# #UNINDENT# } ] #NEWLINE# block_device_mapping = [ { #NEWLINE# #INDENT# 'mount_device' : '/dev/sde' , #NEWLINE# 'device_path' : 'fake_device' , #NEWLINE# #UNINDENT# } ] #NEWLINE# block_device_info = { #NEWLINE# #INDENT# 'root_device_name' : '/dev/sda' , #NEWLINE# 'swap' : swap , #NEWLINE# 'ephemerals' : ephemerals , #NEWLINE# 'block_device_mapping' : block_device_mapping , #NEWLINE# #UNINDENT# } #NEWLINE# empty_block_device_info = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . assertEqual ( driver . block_device_info_get_root ( block_device_info ) , '/dev/sda' ) #NEWLINE# self . assertEqual ( driver . block_device_info_get_root ( empty_block_device_info ) , None ) #NEWLINE# self . assertEqual ( driver . block_device_info_get_root ( None ) , None ) #NEWLINE# self . assertEqual ( driver . block_device_info_get_swap ( block_device_info ) , swap ) #NEWLINE# self . assertEqual ( driver . block_device_info_get_swap ( empty_block_device_info ) [ 'device_name' ] , None ) #NEWLINE# self . assertEqual ( driver . block_device_info_get_swap ( ephemerals ) [ 'swap_size' ] , 0 ) #NEWLINE# self . assertEqual ( driver . block_device_info_get_swap ( { #NEWLINE# #INDENT# 'swap' : None , #NEWLINE# #UNINDENT# } ) [ 'device_name' ] , None ) #NEWLINE# self . assertEqual ( driver . block_device_info_get_swap ( { #NEWLINE# #INDENT# 'swap' : None , #NEWLINE# #UNINDENT# } ) [ 'swap_size' ] , 0 ) #NEWLINE# self . assertEqual ( driver . block_device_info_get_swap ( None ) [ 'device_name' ] , None ) #NEWLINE# self . assertEqual ( driver . block_device_info_get_swap ( None ) [ 'swap_size' ] , 0 ) #NEWLINE# self . assertEqual ( driver . block_device_info_get_ephemerals ( block_device_info ) , ephemerals ) #NEWLINE# self . assertEqual ( driver . block_device_info_get_ephemerals ( empty_block_device_info ) , [ ] ) #NEWLINE# self . assertEqual ( driver . block_device_info_get_ephemerals ( None ) , [ ] )