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

        test_data = [0, None]

        def on_change(value):
            test_data[0] += 1
            test_data[1] = value

        new_content = "hello"
        watch = FileWatch(polling=False)
        watch._clear_all_watches()
        self._validate_empty_internal_map(watch)
        watch.add_watch(tmp_file, on_change, watch_type='serverset')
        self._validate_internal_map(watch, tmp_file, 'serverset', 1)
        time.sleep(1)
        f = open(tmp_file, 'w')
        f.write(new_content)
        f.close()
        watch._check_file_updates()
        self._validate_internal_map(watch, tmp_file, 'serverset', 1)
        old_update_time = os.path.getmtime(tmp_file)
        self.assertEqual(test_data[0], 2)
        self.assertEqual(test_data[1], [new_content])

        time.sleep(1)
        f = open(tmp_file, 'w')
        # Writing the same content
        f.write(new_content)
        f.close()
        new_update_time = os.path.getmtime(tmp_file)
        self.assertNotEqual(old_update_time, new_update_time)
        # Rerun check_updates won't invoke callback
        watch._check_file_updates()
        self._validate_internal_map(watch, tmp_file, 'serverset', 1)
        self.assertEqual(test_data[0], 2)
        self.assertEqual(test_data[1], [new_content])

        del watch
        os.remove(tmp_file)
When monitored serverset has mtime changed but not the content,
dataset/ETHPy150Open pinterest/kingpin/kingpin/tests/kazoo_utils/test_file_watch.py/FileWatchTestCase.test_serverset_content_not_change