~wesley-wiedenmeier/curtin/fix-extended-clear-holders

« back to all changes in this revision

Viewing changes to tests/unittests/test_clear_holders.py

  • Committer: Wesley Wiedenmeier
  • Date: 2016-08-11 00:08:46 UTC
  • Revision ID: wesley.wiedenmeier@gmail.com-20160811000846-w0mfwfovlzxt9hwt
In clear_holders.shutdown_bcache test if device to shut down is already shut
down before doing anything

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
            mock_block.path_to_kname.assert_called_with(self.test_syspath)
116
116
            mock_get_dmsetup_uuid.assert_called_with(self.test_syspath)
117
117
 
 
118
    @mock.patch('curtin.block.clear_holders.os')
118
119
    @mock.patch('curtin.block.clear_holders.LOG')
119
120
    @mock.patch('curtin.block.clear_holders.open')
120
121
    @mock.patch('curtin.block.clear_holders.get_bcache_using_dev')
121
 
    def test_shutdown_bcache(self, mock_get_bcache, mock_open, mock_log):
 
122
    def test_shutdown_bcache(self, mock_get_bcache, mock_open,
 
123
                             mock_log, mock_os):
122
124
        """test clear_holders.shutdown_bcache"""
 
125
        mock_os.path.exists.return_value = True
 
126
        mock_os.path.join.side_effect = os.path.join
123
127
        mock_get_bcache.return_value = self.test_blockdev
124
128
        clear_holders.shutdown_bcache(self.test_syspath)
125
129
        mock_get_bcache.assert_called_with(self.test_syspath)