<s> from __future__ import ( absolute_import , division , generators , nested_scopes , print_function , <EOL> unicode_literals , with_statement ) <EOL> import textwrap <EOL> import unittest <EOL> from contextlib import contextmanager <EOL> from pants . util . contextutil import temporary_file <EOL> class XmlTestBase ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> @ contextmanager <EOL> def xml_file ( self , <EOL> manifest_element = '<STR_LIT>' , <EOL> package_attribute = '<STR_LIT>' , <EOL> package_value = '<STR_LIT>' , <EOL> uses_sdk_element = '<STR_LIT>' , <EOL> android_attribute = '<STR_LIT>' , <EOL> activity_element = '<STR_LIT>' , <EOL> android_name_attribute = '<STR_LIT>' , <EOL> application_name_value = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> with temporary_file ( ) as fp : <EOL> fp . write ( textwrap . dedent ( <EOL> """<STR_LIT>""" . format ( manifest = manifest_element , <EOL> package = package_attribute , <EOL> package_name = package_value , <EOL> uses_sdk = uses_sdk_element , <EOL> android = android_attribute , <EOL> activity = activity_element , <EOL> android_name = android_name_attribute , <EOL> application_name = application_name_value ) ) ) <EOL> fp . close ( ) <EOL> path = fp . name <EOL> yield path </s>
