def test_add_config_monitor(self):
        fd, tmp_file = tempfile.mkstemp()

        test_data = [0, None, None]

        def on_change(value, stat):
            test_data[0] += 1
            test_data[1] = value
            test_data[2] = stat.version

        watch = FileWatch(polling=False)
        watch._clear_all_watches()
        self._validate_empty_internal_map(watch)
        watch.add_watch(tmp_file, on_change)
        self._validate_internal_map(watch, tmp_file, 'config', 1)
        self.assertEqual(test_data[0], 1)
        self.assertEqual(test_data[1], "")
        self.assertEqual(test_data[2], os.path.getmtime(tmp_file))
        del watch
        os.remove(tmp_file)
Stop the daemon.
dataset/ETHPy150Open pinterest/kingpin/kingpin/tests/kazoo_utils/test_file_watch.py/FileWatchTestCase.test_add_config_monitor--crossover with--dataset/ETHPy150Open sivy/pystatsd/pystatsd/daemon.py/Daemon.stop