Currently:
- os.environ is being directly accessed in ~15 places, including in Port. This makes it so that in unit tests, os.environ has to be saved, changed, and reset, which may be error-prone.
- Also, there is an Environment class which is not really used anywhere.
At first, it looks like we may want to use a copy of Environment in SystemHost, but I think that the Environment class isn't really worth it, since it's basically just a dict, and it's simpler to interact with os.environ directly in SystemHost without having a separate Environment class.
Proposal:
1. Change references to os.environ with calls to methods of Host, so that MockHost objects in unit tests won't touch the real os.environ.
2. Also, remove the Environment class.
This will make it easier to test a fix for bug 612730 .
Comment 1 by qyears...@chromium.org
, Jul 15 2016