mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
c3ebc91fdc
Summary: Python 3 type checking currently complains about most of our integration testing since the tests use an `hg_test` decorator to inherit from the base test class. This prevents the type checker from being able to figure out this inheritance. This updates all of the test cases to explicitly derive from the test case base class, rather than using the decorator to do so. I also renamed the base test case class to `EdenHgTestCase` to be slightly more succinct and to follow the common pattern of calling `unittest.TestCase` subclasses `FooTestCase` Reviewed By: bolinfest Differential Revision: D6268258 fbshipit-source-id: 09eef2f8217932a6516f78d17dddcd35c83b73da
26 lines
897 B
Python
26 lines
897 B
Python
#!/usr/bin/env python3
|
|
#
|
|
# Copyright (c) 2004-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 EdenHgTestCase, hg_test
|
|
|
|
|
|
@hg_test
|
|
class RevertTest(EdenHgTestCase):
|
|
def populate_backing_repo(self, repo):
|
|
repo.write_file('hello.txt', 'hola')
|
|
repo.commit('Initial commit.\n')
|
|
|
|
def test_make_local_change_and_attempt_revert(self):
|
|
self.write_file('hello.txt', 'hello')
|
|
self.assert_status({'hello.txt': 'M'})
|
|
self.hg('revert', '--no-backup', 'hello.txt')
|
|
self.assert_status_empty()
|
|
txt_contents = self.read_file('hello.txt')
|
|
self.assertEqual('hola', txt_contents)
|