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.
9 from watchman
.integration
.lib
import WatchmanEdenTestCase
12 class TestEdenUnmount(WatchmanEdenTestCase
.WatchmanEdenTestCase
):
13 def test_eden_unmount(self
) -> None:
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")