<s> import os <EOL> import shutil <EOL> import tempfile <EOL> import zipfile <EOL> import os . path as op <EOL> import mock <EOL> import bento . commands . build_wininst <EOL> from bento . commands . build_wininst import create_wininst <EOL> from bento . compat . api . moves import unittest <EOL> from bento . core . node import create_base_nodes <EOL> from bento . installed_package_description import BuildManifest <EOL> class TestWininstInfo ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . old_dir = None <EOL> self . tmpdir = None <EOL> self . old_dir = os . getcwd ( ) <EOL> self . tmpdir = tempfile . mkdtemp ( ) <EOL> try : <EOL> self . top_node , self . build_node , self . run_node = create_base_nodes ( self . tmpdir , op . join ( self . tmpdir , "<STR_LIT>" ) ) <EOL> os . chdir ( self . tmpdir ) <EOL> except : <EOL> shutil . rmtree ( self . tmpdir ) <EOL> raise <EOL> def tearDown ( self ) : <EOL> os . chdir ( self . old_dir ) <EOL> shutil . rmtree ( self . tmpdir ) <EOL> @ mock . patch ( "<STR_LIT>" , mock . MagicMock ( ) ) <EOL> def test_simple ( self ) : <EOL> """<STR_LIT>""" <EOL> ipackage = BuildManifest ( { } , { "<STR_LIT:name>" : "<STR_LIT:foo>" , "<STR_LIT:version>" : "<STR_LIT:1.0>" } , { } ) <EOL> create_wininst ( ipackage , self . build_node , self . build_node , wininst = "<STR_LIT>" , output_dir = "<STR_LIT>" ) <EOL> arcname = bento . commands . build_wininst . create_exe . call_args [ <NUM_LIT:0> ] [ <NUM_LIT:1> ] <EOL> fp = zipfile . ZipFile ( arcname ) <EOL> try : <EOL> fp . namelist ( ) <EOL> finally : <EOL> fp . close ( ) </s>
