def test_newer_file2_raises_some_error(self):
     with mock.patch('os.stat', self._fake_stat):
         with self.assertRaises(OSError):
             self.assertTrue(newer(self.file1, self.file2))
 def test_newer_file1_is_same_age_as_file2(self):
     self.touch(self.file2, self.stamp)
     self.assertFalse(newer(self.file1, self.file2))
 def test_newer_file2_does_not_exist(self):
     self.assertTrue(newer(self.file1, self.file2))
 def test_newer_file1_is_newer_than_file2(self):
     self.touch(self.file2, self.stamp - 1)
     self.assertTrue(newer(self.file1, self.file2))
 def test_newer_file1_is_older_than_file2(self):
     self.touch(self.file2, self.stamp + 1)
     self.assertFalse(newer(self.file1, self.file2))
Beispiel #6
0
 def test_newer_file2_raises_some_error(self):
     with mock.patch('os.stat', self._fake_stat):
         with self.assertRaises(OSError):
             self.assertTrue(newer(self.file1, self.file2))
Beispiel #7
0
 def test_newer_file2_does_not_exist(self):
     self.assertTrue(newer(self.file1, self.file2))
Beispiel #8
0
 def test_newer_file1_is_same_age_as_file2(self):
     self.touch(self.file2, self.stamp)
     self.assertFalse(newer(self.file1, self.file2))
Beispiel #9
0
 def test_newer_file1_is_older_than_file2(self):
     self.touch(self.file2, self.stamp + 1)
     self.assertFalse(newer(self.file1, self.file2))
Beispiel #10
0
 def test_newer_file1_is_newer_than_file2(self):
     self.touch(self.file2, self.stamp - 1)
     self.assertTrue(newer(self.file1, self.file2))