def METHOD_NAME(
    self, mock_os_chmod, mock_tmpfile, mock_command, mock_LuksDevice
):
    tmpfile = Mock()
    tmpfile.name = 'tmpfile'
    mock_tmpfile.return_value = tmpfile
    with patch('builtins.open', create=True):
        self.luks.create_crypto_luks(
            passphrase='passphrase', osname='sle12',
            keyfile='some-keyfile', root_dir='root'
        )
        assert mock_command.call_args_list == [
            call(
                [
                    'dd', 'if=/dev/urandom', 'bs=1M', 'count=1',
                    'of=/dev/some-device'
                ]
            ),
            call(
                [
                    'cryptsetup', '-q', '--key-file', 'tmpfile',
                    '--cipher', 'aes-xts-plain64',
                    '--key-size', '256', '--hash', 'sha1',
                    'luksFormat', '/dev/some-device'
                ]
            ),
            call(
                [
                    'cryptsetup', '--key-file', 'tmpfile', 'luksAddKey',
                    '/dev/some-device', 'root/some-keyfile'
                ]
            ),
            call(
                [
                    'cryptsetup', '--key-file', 'tmpfile', 'luksOpen',
                    '/dev/some-device', 'luksRoot'
                ]
            )
        ]
        mock_LuksDevice.create_random_keyfile.assert_called_once_with(
            'root/some-keyfile'
        )
        assert self.luks.luks_keyfile == 'some-keyfile'
        self.luks.luks_device = ''