def setup(self, mock_exists, mock_mkdtemp): self.xml_state = mock.Mock() mock_mkdtemp.return_value = 'boot-root-directory' mock_exists.return_value = True self.task = BootImageBase( self.xml_state, 'some-target-dir' ) mock_mkdtemp.assert_called_once_with( prefix='boot-image.', dir='some-target-dir' )
def test_boot_image_task_raises(self): BootImageBase( mock.Mock(), 'target-dir-does-not-exist', 'some-root-dir' )