def _set_up_monitor(self): files = ['file'] file_finder = lambda: files get_file_size = lambda x: 1 get_file_modification_time = lambda x: 1 monitor = Monitor(file_finder, get_file_size, get_file_modification_time) return files, monitor
def _set_up_monitor(self): self.t_files = ['file'] self.t_fsize = 1 self.t_modtime = 1 file_finder = lambda: self.t_files get_file_size = lambda x: self.t_fsize get_file_modification_time = lambda x: self.t_modtime monitor = Monitor(file_finder, get_file_size, get_file_modification_time) return monitor
def test_file_order_does_not_matter(self): files = ['file', 'file2'] file_finder = lambda: files get_file_size = lambda x: 1 get_file_modification_time = lambda x: 1 monitor = Monitor(file_finder, get_file_size, get_file_modification_time) files[:] = ['file2', 'file'] change_detected = monitor.look_for_changes() assert not change_detected
def test_file_size_changed(self): files = ['file'] filesize = [1] file_finder = lambda: files get_file_size = lambda x: filesize[0] get_file_modification_time = lambda x: 1 monitor = Monitor(file_finder, get_file_size, get_file_modification_time) filesize[0] = 5 change_detected = monitor.look_for_changes() assert change_detected