blob: 085977777d2c7fc3d65221e804942aaa22be72d2 [file] [log] [blame]
# Copyright 2020 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
"""Full test of environment module."""
from recipe_engine.recipe_api import Property
DEPS = [
'fuchsia/status_check',
'pigweed/environment',
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
]
def RunSteps(api): # pylint: disable=invalid-name
# pylint: disable=missing-function-docstring
api.environment.init(checkout_root=api.path['start_dir'])
# The next couple lines help cover all of api.py.
_ = api.environment.VIRTUAL_ENV
try:
_ = api.environment.VARIABLE_NAME_UNLIKELY_TO_BE_USED_ELSEWHERE
except AttributeError:
pass
with api.environment():
pass
def GenTests(api): # pylint: disable=invalid-name
props = api.environment.properties(minimal=False, with_cargo=True)
props['$pigweed/environment']['cipd_package_files'].append('empty.json')
yield (
api.status_check.test('with_cargo')
+ api.properties(**props)
+ api.environment.test_data(with_cargo=True)
) # yapf: disable
yield (
api.status_check.test('windows')
+ api.properties(**api.environment.properties(minimal=False))
+ api.environment.test_data(windows=True)
+ api.platform.name('win')
+ api.path.exists(api.path['start_dir'].join('cipd', 'cipd_packages',
'bin', 'python3.exe'))
) # yapf: disable