<s> from __future__ import ( absolute_import , division , generators , nested_scopes , print_function , <EOL> unicode_literals , with_statement ) <EOL> import os <EOL> from pants_test . contrib . android . test_android_base import TestAndroidBase , distribution <EOL> from pants . contrib . android . tasks . zipalign import Zipalign <EOL> class TestZipalign ( TestAndroidBase ) : <EOL> """<STR_LIT>""" <EOL> @ classmethod <EOL> def task_type ( cls ) : <EOL> return Zipalign <EOL> def test_zipalign_smoke ( self ) : <EOL> task = self . create_task ( self . context ( ) ) <EOL> task . execute ( ) <EOL> def test_zipalign_binary ( self ) : <EOL> with distribution ( ) as dist : <EOL> with self . android_binary ( ) as android_binary : <EOL> self . set_options ( sdk_path = dist ) <EOL> task = self . create_task ( self . context ( ) ) <EOL> target = android_binary <EOL> self . assertEqual ( task . zipalign_binary ( target ) , <EOL> os . path . join ( dist , '<STR_LIT>' , target . build_tools_version , '<STR_LIT>' ) ) <EOL> def test_zipalign_out ( self ) : <EOL> with distribution ( ) as dist : <EOL> with self . android_binary ( ) as android_binary : <EOL> self . set_options ( sdk_path = dist ) <EOL> task = self . create_task ( self . context ( ) ) <EOL> target = android_binary <EOL> self . assertEqual ( task . zipalign_out ( target ) , os . path . join ( task . _distdir , target . name ) ) <EOL> def test_render_args ( self ) : <EOL> with distribution ( ) as dist : <EOL> with self . android_binary ( ) as android_binary : <EOL> self . set_options ( sdk_path = dist ) <EOL> task = self . create_task ( self . context ( ) ) <EOL> target = android_binary <EOL> expected_args = [ os . path . join ( dist , '<STR_LIT>' , target . build_tools_version , '<STR_LIT>' ) , <EOL> '<STR_LIT>' , '<STR_LIT:4>' , '<STR_LIT>' , <EOL> os . path . join ( task . _distdir , target . name , <EOL> '<STR_LIT>' . format ( target . manifest . package_name ) ) ] <EOL> self . assertEqual ( task . _render_args ( '<STR_LIT>' , target ) , expected_args ) </s>
