#NEWLINE# def test_get_device_dpi( self ) : #NEWLINE# #INDENT# build_environment = android . BuildEnvironment ( android . BuildEnvironment . build_defaults ( ) ) #NEWLINE# adb_path = build_environment . _find_binary ( android . BuildEnvironment . ADB ) #NEWLINE# run_command_mock = common_test . RunCommandMockList ( [ common_test . RunCommandMock ( self , args = ( '%s devices -l' % adb_path ) , stdout = 'List of devices attached\n123456\tdevice\tusb:2-3.4\tproduct:razor\tmodel:Nexus_7\tdevice:flo\n' ) , common_test . RunCommandMock ( self , args = ( '%s -s 123456 shell getprop ro.sf.lcd_density' % adb_path ) , stdout = '240' ) ] ) #NEWLINE# build_environment . run_subprocess = run_command_mock #NEWLINE# dpi = build_environment . get_device_dpi ( adb_device = '123456' ) #NEWLINE# self . assertEqual ( dpi , 240 )