sapling/eden/integration/hg/status_test.py
Adam Simpkins 227d851a9b update integration tests to support multiple hg configs
Summary:
Update the integration test framework so that we can run the hg integration
tests with several different hg config settings, using different sets of
mercurial extensions.

This adds code to test using flat manifest, treemanifest in hybrid mode, and
treemanifest in tree only mode.  However, the treeonly configuration is
disabled at the moment due to some bugs in treeonly behavior preventing it from
being able to create test repositories in treeonly mode.

Reviewed By: bolinfest

Differential Revision: D5685880

fbshipit-source-id: 081ead4e77cd14a7feb03381783395bd5a8fef4f
2017-08-23 18:49:33 -07:00

47 lines
1.3 KiB
Python

#!/usr/bin/env python3
#
# Copyright (c) 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from .lib.hg_extension_test_base import hg_test
@hg_test
class StatusTest:
def populate_backing_repo(self, repo):
repo.write_file('hello.txt', 'hola')
repo.commit('Initial commit.')
def test_status(self):
'''Test various `hg status` states in the root of an Eden mount.'''
self.assert_status_empty()
self.touch('world.txt')
self.assert_status({'world.txt': '?'})
self.hg('add', 'world.txt')
self.assert_status({'world.txt': 'A'})
self.rm('hello.txt')
self.assert_status({
'hello.txt': '!',
'world.txt': 'A',
})
with open(self.get_path('hello.txt'), 'w') as f:
f.write('new contents')
self.assert_status({
'hello.txt': 'M',
'world.txt': 'A',
})
self.hg('rm', '--force', 'hello.txt')
self.assert_status({
'hello.txt': 'R',
'world.txt': 'A',
})