Re-sync with internal repository
[hiphop-php.git] / third-party / watchman / src / watchman / integration / eden / test_eden_unmount.py
blobd01c1b898783edd7232b70ce7fb38efc3d087f81
1 # vim:ts=4:sw=4:et:
2 # Copyright (c) Meta Platforms, Inc. and affiliates.
4 # This source code is licensed under the MIT license found in the
5 # LICENSE file in the root directory of this source tree.
8 import pywatchman
9 from watchman.integration.lib import WatchmanEdenTestCase
12 class TestEdenUnmount(WatchmanEdenTestCase.WatchmanEdenTestCase):
13 def test_eden_unmount(self) -> None:
14 def populate(repo):
15 repo.write_file(".watchmanconfig", '{"ignore_dirs":[".buckd"]}')
16 repo.write_file("hello", "hola\n")
17 repo.commit("initial commit.")
19 root = self.makeEdenMount(populate)
20 self.watchmanCommand("watch", root)
22 clock = self.watchmanCommand("clock", root)
23 self.touchRelative(root, "newfile")
25 # pyre-fixme[16]: Optional type has no attribute `unmount`.
26 self.eden.unmount(root)
28 with self.assertRaises(pywatchman.CommandError) as ctx:
29 self.watchmanCommand("query", root, {"fields": ["name"], "since": clock})
31 self.assertRegex(str(ctx.exception), "unable to resolve root")