def test_symlinks_differ_in_whether_they_compute_crc(self): self._add_to_db('o1', 'i1', 'i2') # Start the update-transaction, as needed to call can_symlink_to(). filemod_db.changed_files('o2', 'i1', 'i2', context='test', compute_crc=True) self.assertTrue(filemod_db.can_symlink_to('o2', 'o1'))
def test_symlink_candidate_is_in_transaction(self): self._add_to_db('o1', 'i1', 'i2') filemod_db.changed_files('o2', 'i1', 'i2', context='test') self._change_mtime('o1') self.assertEqual(set(['o1']), filemod_db.changed_files('o1', 'i1', 'i2')) self.assertFalse(filemod_db.can_symlink_to('o2', 'o1'))
def test_symlink_to_self(self): self._add_to_db('o2', 'i1', 'i2') # We need to do this to force changed_files to return False. self._change_mtime('i1') filemod_db.changed_files('o2', 'i1', 'i2', context='test') self.assertFalse(filemod_db.can_symlink_to('o2', 'o2'))
def test_infile_has_changed(self): self._add_to_db('o1', 'i1', 'i2') self._change_mtime('i1') filemod_db.changed_files('o2', 'i1', 'i2', context='test') self.assertFalse(filemod_db.can_symlink_to('o2', 'o1'))
def test_infile_is_symlink(self): self._add_to_db('o1', 'l1', 'l22') filemod_db.changed_files('o2', 'i1', 'i2', context='test') self.assertTrue(filemod_db.can_symlink_to('o2', 'o1'))
def test_different_input(self): self._add_to_db('o1', 'i1', 'i2', 'i3') filemod_db.changed_files('o2', 'i1', 'i2', context='test') self.assertFalse(filemod_db.can_symlink_to('o2', 'o1'))
def test_same_input(self): self._add_to_db('o1', 'i1', 'i2') # Start the update-transaction, as needed to call can_symlink_to(). filemod_db.changed_files('o2', 'i1', 'i2', context='test') self.assertTrue(filemod_db.can_symlink_to('o2', 'o1'))