sapling/eden/integration/hg/debug_hg_get_dirstate_tuple_test.py
Adam Simpkins c3ebc91fdc update hg integration test inheritance to allow type checking
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
2017-11-07 19:04:20 -08:00

32 lines
1009 B
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 EdenHgTestCase, hg_test
from textwrap import dedent
@hg_test
class DebugHgGetDirstateTupleTest(EdenHgTestCase):
def populate_backing_repo(self, repo):
repo.write_file('hello', 'hola\n')
repo.write_file('dir/file', 'blah\n')
repo.commit('Initial commit.')
def test_get_dirstate_tuple_normal_file(self):
output = self.eden.run_cmd(
'debug', 'hg_get_dirstate_tuple', self.get_path('hello')
)
expected = dedent('''\
hello
status = Normal
mode = 0o100644
mergeState = NotApplicable
''')
self.assertEqual(expected, output)