blob: 089d8a54e6b5d8fbea585f29c288b1690e928ecb [file] [log] [blame]
# -*- coding: utf-8 -*-
# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
def RunSteps(api):
cwd = api.path['cleanup']
with api.context(cwd=cwd):
# diff_manifests_informational calls _find_root(). Use that to cover
# both cases in one test.
# Next, call _find_root from a subdirectory. Should not affect
# context.cwd.
cwd = api.path['cleanup'].join('test', 'dir', 'sub')
api.file.ensure_directory('test dir', cwd)
expected = str(cwd)
api.path.mock_add_paths(api.path['cleanup'].join('test', '.repo'))
with api.context(cwd=cwd):
api.repo._find_root() # pylint: disable=protected-access
api.assertions.assertEqual(expected, str(api.context.cwd))
def GenTests(api):
yield api.test('tests')