Ejemplo n.º 1
0
 def test__delete_dest_path_if_stale_up_to_date(self, mock_unlink):
     touch(self.master_path)
     os.link(self.master_path, self.dest_path)
     res = image_cache._delete_dest_path_if_stale(self.master_path,
                                                  self.dest_path)
     self.assertFalse(mock_unlink.called)
     self.assertTrue(res)
Ejemplo n.º 2
0
 def test__delete_dest_path_if_stale_out_of_date(self, mock_unlink):
     touch(self.master_path)
     touch(self.dest_path)
     res = image_cache._delete_dest_path_if_stale(self.master_path,
                                                  self.dest_path)
     mock_unlink.assert_called_once_with(self.dest_path)
     self.assertFalse(res)
Ejemplo n.º 3
0
 def test__delete_dest_path_if_stale_no_dest(self, mock_unlink):
     res = image_cache._delete_dest_path_if_stale(self.master_path,
                                                  self.dest_path)
     self.assertFalse(mock_unlink.called)
     self.assertFalse(res)
Ejemplo n.º 4
0
 def test__delete_dest_path_if_stale_no_dest(self, mock_unlink):
     res = image_cache._delete_dest_path_if_stale(self.master_path,
                                                  self.dest_path)
     self.assertFalse(mock_unlink.called)
     self.assertFalse(res)
Ejemplo n.º 5
0
 def test__delete_dest_path_if_stale_no_master(self, mock_unlink):
     touch(self.dest_path)
     res = image_cache._delete_dest_path_if_stale(self.master_path,
                                                  self.dest_path)
     mock_unlink.assert_called_once_with(self.dest_path)
     self.assertFalse(res)