#NEWLINE# def test_find_android_sdk( self ) : #NEWLINE# #INDENT# d = android . BuildEnvironment . build_defaults ( ) #NEWLINE# b = android . BuildEnvironment ( d ) #NEWLINE# m = common_test . RunCommandMock ( self ) #NEWLINE# b . run_subprocess = m #NEWLINE# expect = [ 'android' , 'list' , 'target' , '--compact' ] #NEWLINE# m . expect ( expect ) #NEWLINE# m . returns ( 'android-3\nandroid-5\nmeaningless\nandroid-10\nandroid-L\n' ) #NEWLINE# got = b . _find_best_android_sdk ( 'android' , 1 , 5 ) #NEWLINE# self . assertEqual ( got , 'android-5' ) #NEWLINE# got = b . _find_best_android_sdk ( 'android' , 5 , 15 ) #NEWLINE# self . assertEqual ( got , 'android-10' ) #NEWLINE# got = b . _find_best_android_sdk ( 'android' , 1 , 2 ) #NEWLINE# self . assertEqual ( got , 'android-10' ) #NEWLINE# with self . assertRaises ( common . ConfigurationError ) : #NEWLINE# #INDENT# b . _find_best_android_sdk ( 'android' , 11 , 20 ) #NEWLINE# #UNINDENT# m . returns ( 'android-10\nandroid-15\nandroid-7\n' ) #NEWLINE# got = b . _find_best_android_sdk ( 'android' , 5 , 15 ) #NEWLINE# self . assertEqual ( got , 'android-15' )