one = "1\n"
two = "2\n"
three = "3\n"
task, target = self._fixture(incremental=True)
// Clean - this is the first run so the VT is invalid.
self._create_clean_file(target, one)
vtA, was_A_valid = task.execute()
self.assertFalse(was_A_valid)
self.assertContent(vtA, one)
After Change
def test_incremental(self):
Run three times with two unique fingerprints.
self._write_build_file()
one = "1\n"
two = "2\n"
three = "3\n"
// Clean - this is the first run so the VT is invalid.
self._create_clean_file(one)
task = self._task(incremental=True)
vtA, was_A_valid = task.execute()
self.assertFalse(was_A_valid)
self.assertContent(vtA, one)
// Changed the source file, so it copies the results from vtA.
self._create_clean_file(two)
task = self._task(incremental=True)
vtB, was_B_valid = task.execute()
self.assertFalse(was_B_valid)
self.assertEqual(vtB.previous_cache_key, vtA.cache_key)
self.assertContent(vtB, one + two)