def METHOD_NAME(self, config, expect) -> None:
    with WatchmanInstance.Instance(config=config) as inst:
        inst.start()
        client = self.getClient(inst)
        for filetype, name, expect_pass in expect:
            for watch_type in ["watch", "watch-project"]:
                # encode the test criteria in the dirname so that we can
                # figure out which test scenario failed more easily
                d = self.mkdtemp(
                    suffix="-%s-%s-%s-%s"
                    % (filetype, name, expect_pass, watch_type)
                )
                if filetype == "directory":
                    os.mkdir(os.path.join(d, name))
                elif filetype == "file":
                    self.touchRelative(d, name)
                assert_functions = {
                    (True, "watch"): self.assertWatchSucceeds,
                    (True, "watch-project"): self.assertWatchProjectSucceeds,
                    (False, "watch"): self.assertWatchIsRestricted,
                    (False, "watch-project"): self.assertWatchProjectIsRestricted,
                }
                assert_function = assert_functions[(expect_pass, watch_type)]
                assert_function(inst, client, d)