<s> import unittest <EOL> from vint . compat . unittest import mock <EOL> from pathlib import Path <EOL> from vint . linting . env import build_environment <EOL> FIXTURE_PATH = Path ( '<STR_LIT:test>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class TestEnv ( unittest . TestCase ) : <EOL> def test_build_environment ( self ) : <EOL> cwd = Path ( '<STR_LIT:path>' , '<STR_LIT:to>' , '<STR_LIT>' ) <EOL> home = Path ( '<STR_LIT:/>' , '<STR_LIT>' , '<STR_LIT:user>' ) <EOL> cmdargs = { <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : <NUM_LIT:10> , <EOL> '<STR_LIT>' : [ str ( FIXTURE_PATH ) ] , <EOL> } <EOL> expected_env = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : [ str ( FIXTURE_PATH ) ] , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : <NUM_LIT:10> , <EOL> } , <EOL> '<STR_LIT>' : set ( [ <EOL> Path ( FIXTURE_PATH , '<STR_LIT>' ) , <EOL> Path ( FIXTURE_PATH , '<STR_LIT>' ) , <EOL> Path ( FIXTURE_PATH , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> Path ( FIXTURE_PATH , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] ) , <EOL> '<STR_LIT>' : home , <EOL> '<STR_LIT>' : cwd , <EOL> } <EOL> with mock . patch ( '<STR_LIT>' ) as mocked_getcwd : <EOL> mocked_getcwd . return_value = str ( cwd ) <EOL> with mock . patch ( '<STR_LIT>' ) as mocked_expanduser : <EOL> mocked_expanduser . return_value = str ( home ) <EOL> env = build_environment ( cmdargs ) <EOL> self . maxDiff = <NUM_LIT:1000> <EOL> self . assertEqual ( env , expected_env ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
