text:
<?php
namespace Forward\TikonGenerator;

class Invoice
{
    const TYPE_SALESDECLINE = 'M';
    const TYPE_INVOICE = 'O';

    const DOCUMENTTYPE_INVOICE = 1;
    const DOCUMENTTYPE_CREDIT = 2;
    const DOCUMENTTYPE_PENI = 3;
    const DOCUMENTTYPE_ADVANCE = 4;

    const PAYCODE_SALESINVOICE_NORMAL_RECOVERIES = 0;
    const PAYCODE_SALESINVOICE_NOTPRINT_COLLECTION_LETTERS = 1;

    const PAYCODE_PURCHINVOICE_NORMAL_PAYMENTS = 0;
    const PAYCODE_PURCHINVOICE_INVOICE_PAYMENTS = 1;
    const PAYCODE_PURCHINVOICE_DECLINE_IN_DIRECT_DEBIT = 2;
    const PAYCODE_PURCHINVOICE_PAID_BILL = 3;
    const PAYCODE_PURCHINVOICE_CURRENCY_PAYMENTS = 4;
    const PAYCODE_PURCHINVOICE_NOT_RECOGNIZED_IN_DECLINE = 5;
    const PAYCODE_PURCHINVOICE_VALUUTTAMAKASTUSLASKU = 5;

    /** @var InvoiceLine[] $lines array of InvoiceLine objects*/
    public $lines = [];

    /**
     * @var int
     * Yritysnumero
     * Yritysnumero Tikonissa, pakollinen moniyrityssiirrossa.
     *
     * Company number Tikonissa, compulsory multi-company transfer.
     *
     * Start at pos. 4
     * Output as 4 digits
     */
    public $companyNumber = 0;

    /**
     * @var int The
     * Asiakas/toimittajanumero
     * Asiakkaan/toimittajan tunnus Asiakas-taulussa.
     *
     * Customer / supplier identification Customer table.
     *
     * Start at pos. 8
     * Output as 8 digits
     */
    public $customerOrVendorNumber = 0;

    /**
     * @var int
     * Laskulaji
     * Laskulaji ja laskunumero muodostavat reskontran laskunumeron. Laskulaji on tositelaji (kirjanpidon Tositelajit-taulussa).
     * Laskulaji on nolla, jos tositelajit eivät ole käytössä.
     *
     * The billing type and the invoice number form the ledger invoice number. The billing type is VERIFICATIONS (accounting Voucher types-table).
     * The billing type is zero, if the Document types are not in use."
     *
     * Start at pos. 16
     * Output as 2 digits
     */
    public $landingEvent = 0;

    /**
     * @var int
     * Laskunumero
     *
     * The billing type and the invoice number form the ledger invoice number. The billing type is VERIFICATIONS (accounting Voucher types-table).
     * The billing type is zero, if the Document types are not in use."
     *
     * The invoice number
     *
     * Start at pos. 18
     * Output as 6 digits
     */
    public $invoiceNumber = 0;

    /**
     * @var int
     * Saatava/velkatili
     * Saatava/velkatili on myyntilaskulla kirjanpidon myyntisaamistili ja ostolaskulla kirjanpidon ostovelkatili.
     *
     * Assets / liabilities account is a sales invoice accounting myyntisaamistili and purchase invoice of purchase accounting liability account.
     *
     * Start at pos. 24
     * Output as 6 digits
     */
    public $assetsOrLiabilitiesAccountNumber = 0;

    /**
     * @var string
     * Toimittajan laskunumero
     * vain ostolaskulla (vanha lyhyt muoto, uusi kentässä 35)
     *
     * The supplier invoice number
     * Only the purchase invoice (the old short form, a new field of 35)
     *
     * Start at pos. 30
     * Output as 10 alphanumeric
     */
    public $supplierInvoiceNumberShort = '';

    /**
     * @var int
     * Tositelaji
     * Tositelaji, tositenumero, tositenumeron tarkenne 1 ja tositenumeron tarkenne 2 yhdessä muodostavat kirjanpidon tositenumeron.
     * Tositelaji on kirjanpidon Tositelajit-taulussa oleva tositelaji. Tositelaji on nolla, jos tositelajit eivät ole käytössä.
     *
     * VERIFICATIONS
     * The sorts of vouchers, voucher number, the document number and the document number 1 qualifier qualifier two together make up the accounting document number.
     * VERIFICATIONS is the accounting-panel voucher types Voucher types. VERIFICATIONS is zero, if the Document types are not in use.
     *
     * Start at pos. 40
     * Output as 2 digits
     */
    public $verifications = 0;

    /**
     * @var int
     * Tositenumero
     * Tositelaji, tositenumero, tositenumeron tarkenne 1 ja tositenumeron tarkenne 2 yhdessä muodostavat kirjanpidon tositenumeron.
     * Tositelaji on kirjanpidon Tositelajit-taulussa oleva tositelaji. Tositelaji on nolla, jos tositelajit eivät ole käytössä.
     *
     * Document Number
     * The sorts of vouchers, voucher number, the document number and the document number 1 qualifier qualifier two together make up the accounting document number.
     * VERIFICATIONS is the accounting-panel voucher types Voucher types. VERIFICATIONS is zero, if the Document types are not in use.
     *
     * Start at pos. 42
     * Output as 6 digits
     */
    public $documentNumber = 0;

    /**
     * @var int
     * Tositenumeron tarkenne 1
     * Tositelaji, tositenumero, tositenumeron tarkenne 1 ja tositenumeron tarkenne 2 yhdessä muodostavat kirjanpidon tositenumeron.
     * Tositelaji on kirjanpidon Tositelajit-taulussa oleva tositelaji. Tositelaji on nolla, jos tositelajit eivät ole käytössä.
     *
     * The document number specifier 1
     * The sorts of vouchers, voucher number, the document number and the document number 1 qualifier qualifier two together make up the accounting document number.
     * VERIFICATIONS is the accounting-panel voucher types Voucher types. VERIFICATIONS is zero, if the Document types are not in use.
     *
     * Start at pos. 48
     * Output as 3 digits
     */
    public $documentNumber1 = 0;

    /**
     * @var int
     * Tositenumeron tarkenne 2
     * Tositelaji, tositenumero, tositenumeron tarkenne 1 ja tositenumeron tarkenne 2 yhdessä muodostavat kirjanpidon tositenumeron.
     * Tositelaji on kirjanpidon Tositelajit-taulussa oleva tositelaji. Tositelaji on nolla, jos tositelajit eivät ole käytössä.
     *
     * The document number 2 qualifier
     * The sorts of vouchers, voucher number, the document number and the document number 1 qualifier qualifier two together make up the accounting document number.
     * VERIFICATIONS is the accounting-panel voucher types Voucher types. VERIFICATIONS is zero, if the Document types are not in use.
     *
     * Start at pos. 51
     * Output as 3 digits
     */
    public $documentNumber2 = 0;

    /**
     * @var \DateTimeInterface
     * Tositepvm
     *
     * Document date
     *
     * Start at pos. 54
     * Output as 10 digits DDMMYYYY, NB, in front of two zeros.
     */
    public $documentDate;

    /**
     * @var \DateTimeInterface
     * Laskun pvm
     *
     * Invoice date
     *
     * Start at pos. 64
     * Output as 10 digits DDMMYYYY, NB, in front of two zeros.
     */
    public $invoiceDate;

    /**
     * @var \DateTimeInterface
     * Eräpvm
     *
     * Due Date
     *
     * Start at pos. 74
     * Output as 10 digits DDMMYYYY, NB, in front of two zeros.
     */
    public $dueDate;

    /**
     * @var \DateTimeInterface
     * Käteisalennuksen eräpvm
     *
     * Discount Due Date
     *
     * Start at pos. 84
     * Output as 10 digits DDMMYYYY, NB, in front of two zeros.
     */
    public $discountDueDate;

    /**
     * @var string
     * Myyjätunnus/kustannuspaikka
     * Myyntilaskulla myyjätunnus (reskontran Myyja-taulu), ostolaskulla kustannuspaikka (kirjanpidon Kustannuspaikka-taulu).
     *
     * Sales Invoice Vendor ID (ledger Seller-flat), the purchase invoice cost center (cost center accounting-flat).
     *
     * Vendor ID / cost center
     *
     * Start at pos. 94
     * Output as 8 alphanumeric
     */
    public $vendorId = '';

    /**
     * @var string
     * Selite
     *
     * Vendor Name
     *
     * Start at pos. 102
     * Output as 72 alphanumeric
     */
    public $vendorName = '';

    /**
     * @var string
     * Laji
     * "M" = myyntilasku, "O" = ostolasku
     *
     * Type
     * "M" = the sales decline, "O" = invoice
     *
     * Start at pos. 174
     * Output as 1 char: "M" or "O"
     */
    public $type = '';

    /**
     * @var int
     * Vientilaji
     * 1 = tavall.lasku, 2 = hyvitysl., 3 = korkol., 4 = ennakko
     *
     * Document Type
     * 1 = invoice, 2 = credit, 3 = peni, 4 = advance (prepaid)
     *
     * Start at pos. 175
     * Output as 2 digits
     */
    public $documentType = 0;

    /**
     * @var int
     * Maksuehto
     *
     * Terms of payment
     *
     * Start at pos. 177
     * Output as 3 digits
     */
    public $termsOfPayment = 0;

    /**
     * @var int
     * Käteisalennus%
     * 3 kokonaista, 1 desimaali, ei desim.erotinta
     *
     * Discount %
     * 3 full, 1 decimal, not desim.erotinta
     *
     * Start at pos. 180
     * Output as 4 digits
     */
    public $discountPercent = 0;

    /**
     * @var string
     * Perusrahayksikkö
     * isoilla kirjaimilla, virallinen lyhenne: esim. FIM, EUR.
     * Jos perusrahayksikköä ei ole annettu, niin sitä tullaan tapahtumia noudettaessa kysymään
     *
     * Basic currency
     * In capital letters, the official abbreviation. eg FIM, EUR.
     *
     * Start at pos. 184
     * Output as 3 alphanumeric
     */
    public $basicCurrency = '';

    /**
     * @var float
     * Lasku perusrahayksiköissä
     * mk- tai euro-määrä, 14 kokonaista, 2 desimaalia, ei desim.erotinta
     *
     * Amount in Base Currency
     * k- or euro-denominated, 14 full, 2 decimals, not desim.erotinta
     *
     * Start at pos. 187
     * Output as 16 digits
     */
    public $amountInBaseCurrency = 0;

    /**
     * @var string
     * Valuuttakoodi
     * isoilla kirjaimilla, virallinen lyhenne
     *
     * Invoice Currency
     * in capital letters, the official abbreviation
     *
     * Start at pos. 203
     * Output as 3 alphanumeric
     */
    public $invoiceCurrency = '';

    /**
     * @var float
     * Valuuttakurssi
     * 3 kokonaista, 6 desimaalia, ei desim.erotinta, (Ei käytössä)
     *
     * Exchange Rate
     * 3 whole, 6 decimals, not desim.erotinta, (Off)
     *
     * Start at pos. 206
     * Output as 9 digits
     */
    public $exchangeRate = 0;

    /**
     * @var float
     * Lasku valuutassa
     * 14 kokonaista, 2 desimaalia, ei desim.erotinta
     *
     * Invoice Amount
     * 14 full, 2 decimals, not desim.erotinta
     *
     * Start at pos. 215
     * Output as 16 digits
     */
    public $invoiceAmount = 0;

    /**
     * @var bool
     * Osamaksulasku
     * 1 = osamaksulasku
     *
     * Part payment invoice
     * 1 = installment bill
     *
     * Start at pos. 231
     * Output as 1 or 0
     */
    public $partPayment = false;

    /**
     * @var int
     * Perintä/maksat. koodi
     * myyntilaskulla: 0= normaali perintä, 1 = lasku ei tulostu perintäkirjeelle,
     * ostolaskulla: 0= normaali maksatus,  1=lasku maksukiellossa, 2=lasku suoraveloituksessa, 3=valuuttamaksatuksella maksettava lasku,
     * 4=valuuttamaksatuksen lasku maksukiellossa, 5=esikirjattu lasku, 6=esikirjattu valuuttamakastuslasku
     *
     * Payment Code
     * a sales invoice: 0 = normal recoveries, 1 = invoice does not print collection letters,
     * the purchase invoice: 0 = normal payment, 1 = invoice's payments, 2 = decline in direct debit, 3 = paid valuuttamaksatuksella bill
     * 4 = currency payments fall's payments, 5 = not recognized in decline, ancestor recorded 6 = valuuttamakastuslasku
     *
     * Start at pos. 232
     * Output as 1 digit
     */
    public $payCode = 0;

    /**
     * @var int
     * Perintäkertojen lkm
     * Vain myyntilaskulla. Montako perintäkirjettä laskusta on lähetetty.
     *
     * Debt collection number of times
     * Only the sales invoice. How many collection letters invoice has been sent."
     *
     * Start at pos. 233
     * Output as 2 digits
     */
    public $collectionNumbers = 0;

    /**
     * @var bool
     * Korkoesto
     * 1 = lasku ei tulostu korkolaskulle
     *
     * Interest theft
     * 1 = decrease in the interest rate does not print the invoice
     *
     * Start at pos. 235
     * Output as 1 or 0
     */
    public $interestTheft = false;

    /**
     * @var \DateTimeInterface
     * Korkopvm
     * vain myyntilaskulla, PPKKVVVV, Huom, eteen kaksi nollaa.
     * Korkopvm on päivämäärä, johon asti korko on laskettu
     *
     * Interest Date
     * just a sales invoice
     * Interest date is the date until which the interest rate is calculated
     *
     * Start at pos. 236
     * Output as 10 digits DDMMYYYY, NB, in front of two zeros.
     */
    public $interestDate;

    /**
     * @var string
     * Viitenumero
     *
     * Reference Number
     *
     * Start at pos. 246
     * Output as 20 digits
     */
    public $referenceNumber = '';

    /**
     * @var string
     * Pankkiviesti
     * Pankkiviestiä käytetään ostolaskujen maksatuksessa.  Pankkiviesti välitetään maksunsaajalle,
     * jos laskulla ei ole viitenumeroa.
     *
     * Bank Message
     * Only the purchase invoice.
     * The Bank of message is used to invoice payment. Bank message is transmitted to the payee,
     * if the bill is not the reference number.
     *
     * Start at pos. 266
     * Output as 70 alphanumeric
     */
    public $bankMessage = '';

    /**
     * @var int
     * Maksuluokka
     *
     * Pay Category
     *
     * Start at pos. 336
     * Output as 2 digits
     */
    public $payCategory = 0;

    /**
     * @var int
     * Toimittajan pankkitili
     * vain ostolaskulla, konekielisessä muodossa
     *
     * Editor's bank account
     * Only the purchase invoice in electronic format
     *
     * Start at pos. 338
     * Output as 16 digits
     */
    public $editorBankAccount = 0;

    /**
     * @var string
     * Toimittajan laskunumero
     * vain ostolaskulla
     *
     * The supplier invoice number
     * Only the purchase invoice
     *
     * Start at pos. 338
     * Output as 20 aplpanumeric
     */
    public $supplierInvoiceNumber = '';

    /**
     * @var string
     * Käteisalennustili
     *
     * Cash Account
     *
     * Start at pos. 354
     * Output as 6 alphanumeric
     */
    public $cacheAccount = '';

    /**
     * @var int
     * Kät.ale.kotival.
     *
     * The amount of the cash discount in the local currency
     *
     * Start at pos. 374
     * Output as 16 digits
     */
    public $discountAmoountInLocalCurrency = 0;

    /**
     * @var int
     * Kät.ale.valuutt.
     * Käteisalennuksen määrä valuuttana
     *
     * The amount of the cash discount currency
     *
     * Start at pos. 380
     * Output as 16 digits
     */
    public $discountAmoountInOriginalCurrency = 0;

    /**
     * @var string
     * Hyväksyjä
     * Laskun hyväksyjä Laskuhotellissa tai Personec workflow:ssa
     *
     * The invoice shall Landing hotel or Personec workflow for
     *
     * Start at pos. 396
     * Output as 40 alphanumeric
     */
    public $acceptor = '';

    /**
     * @var string
     * WF laskun Id
     * Workflow laskun Id
     *
     * Start at pos. 412
     * Output as 10 alphanumeric
     */
    public $workflowBidId = '';

    /**
     * @var string
     * IBAN-tilinumero
     * IBAN-tilinumero (LUM2:n maksutietueen pos.300-333,  pituus 34)
     *
     * IBAN
     * IBAN (LUM2's payment record pos.300-333, length 34)
     *
     * Start at pos. 462
     * Output as 34 alphanumeric
     */
    public $iban = '';

    /**
     * @var string
     * Tilinumero
     * Ulkomainen kansallinen tilinumero. Käytetään vain, jos ei ole IBAN-tilinumeroa. (LUM2:n maksutietueen pos.300-333,  pituus 34)
     *
     * Account Number
     * A foreign national account number. Applies only if there is no IBAN. (LUM2 of the payment pos.300-333, length 34)
     *
     * Start at pos. 496
     * Output as 34 alphanumeric
     */
    public $accountNumberIfNoIban = '';

    /**
     * @var string
     * BIC / SWIFT
     * Pankin BIC-/SWIFT-koodi (LUM2:n maksutietueen pos.149-159,  pituus 11)
     *
     * BIC / SWIFT
     * The bank's BIC / SWIFT code (LUM2's payment record pos.149-159, length 11)
     *
     * Start at pos. 530
     * Output as 11 alphanumeric
     */
    public $bicSwift = '';

    /**
     * @var string
     * Pankin nimi/osoite, 1. rivi. (LUM2:n maksutietueen pos.160-194,  pituus 35)
     *
     * Bank name / address on the 1st line. (LUM2 of the payment pos.160-194, length 35)
     *
     * Start at pos. 541
     * Output as 35 alphanumeric
     */
    public $bankNameAddress1 = '';

    /**
     * @var string
     * Pankin nimi/osoite, 2. rivi. (LUM2:n maksutietueen pos.195-229,  pituus 35)
     *
     * Bank Name / Address, 2nd line. (LUM2 of the payment pos.195-229, length 35)
     *
     * Start at pos. 576
     * Output as 35 alphanumeric
     */
    public $bankNameAddress2 = '';

    /**
     * @var string
     * Pankin nimi/osoite, 3. rivi. (LUM2:n maksutietueen pos.230-264,  pituus 35)
     *
     * Bank name / address, 3rd line. (LUM2 of the payment pos.230-264, length 35)
     *
     * Start at pos. 611
     * Output as 35 alphanumeric
     */
    public $bankNameAddress3 = '';

    /**
     * @var string
     * Pankin nimi/osoite, 4. rivi. (LUM2:n maksutietueen pos.265-299,  pituus 35)
     *
     * Bank Name / Address 4th row. (LUM2 of the payment pos.265-299, length 35)
     *
     * Start at pos. 646
     * Output as 35 alphanumeric
     */
    public $bankNameAddress4 = '';

    /**
     * @var string
     * Maksutapa
     * Maksutapa ( M, P, Q, S, T, K, R tai B). Huomioi, että kaikki maksutapakoodit eivät ole käytössä kaikissa pankeissa. (LUM2:n maksutietueen pos.509-509,  pituus 1)
     *
     * Payment method (M, P, Q, S, T, K, R or B). Please note that all payment codes are not available in all banks. (LUM2 of the payment pos.509-509, the length of one)
     *
     * Start at pos. 681
     * Output as 1 char
     */
    public $paymentMethod = '';

    /**
     * @var string
     * Palvelumaksu
     * Tieto pankkipalvelumaksujen maksajasta ( J, T tai V). Huomioi, että kaikki palvelumaksukoodit eivät ole käytössä kaikissa pankeissa. (LUM2:n maksutietueen pos.510-510,  pituus 1)
     *
     * Information on the payer bank charges (J, T or V). Please note that all payment service tags are not enabled for all banks. (LUM2 of the payment pos.510-510, the length of one)
     *
     * Start at pos. 682
     * Output as 1 char
     */
    public $serviceFee = '';

    /**
     * @var string
     * Viestin loppuosa
     *
     * Beneficiary bank to deliver to the remainder of the message (LUM2 of the payment pos.404-473, length 70)
     *
     * Start at pos. 683
     * Output as 70 alphanumeric
     */
    public $bankMessageRest = '';

    /**
     * @var string
     * Kurssisopimus
     * Pankin kanssa tehdyn valuuttakaupan kurssisopimustunnus (LUM2:n maksutietueen pos.495-508,  pituus 14)
     *
     * Agreement with the Bank's foreign exchange trading price of the contract ID (LUM2's payment record pos.495-508, length 14)
     *
     * Start at pos. 753
     * Output as 14 alphanumeric
     */
    public $courseCondition = '';

    /**
     * @var string
     * Kurssis. Kurssi
     * Kurssisopimuksen informatiivinen kurssi, jota ei välitetä pankkiin. Käytetään maksatuksen tulosteilla muunnettaessa valuutta-arvoja euroiksi. Pituus 5 kokonaista ja 6 desimaalia.
     *
     * The course of the contract informative course, which is not transmitted to the bank. Used for payment of prints for converting monetary values into euros. Length 5 full and 6 decimal places.
     *
     * Start at pos. 767
     * Output as 11 alphanumeric
     */
    public $courseCourse = '';
}


text:
import logging
from typing import Union

from esipy import EsiClient
from urllib3.exceptions import ReadTimeoutError

from waitlist.storage.database import SSOToken
from waitlist.utility.swagger.eve import get_esi_client, get_expire_time, make_error_response, ESIEndpoint, ESIResponse
from waitlist.utility.swagger.eve.character.responses import CharacterInfo, FleetInfo

logger = logging.getLogger(__name__)

class CharacterEndpoint(ESIEndpoint):
    def __init__(self) -> None:
        super().__init__()
        self.esi_client: EsiClient = get_esi_client(None, True,
                                                    retry_request=True)

    def get_character_info(self, char_id: int) -> Union[
            CharacterInfo,
            ESIResponse]:

        try:
            resp = self.esi_client.request(self._api().op['get_characters_character_id'](character_id=char_id))
            if resp.status == 200:
                return CharacterInfo(get_expire_time(resp), resp.status, None, resp.data)
            else:
                logger.info(f'Got error requesting info for character={char_id}')
                return make_error_response(resp)

        except ReadTimeoutError as e:
            logger.error(f'ESI Read Timeout on get_characters_character_id {e}')
            raise e

    def get_fleet_info(self, token: SSOToken, char_id: int) -> Union[FleetInfo, ESIResponse]:
        authed_esi_client = get_esi_client(token, False)
        try:
            resp = authed_esi_client.request(self._api().op['get_characters_character_id_fleet'](character_id=char_id))
            if resp.status == 200:
                return FleetInfo(get_expire_time(resp), resp.status, None, resp.data)
            else:
                logger.error(f'Got error requesting fleet info for character={char_id}')
                return make_error_response(resp)
        except ReadTimeoutError as e:
            logger.error(f'ESI Read Timeout on get_characters_character_id {e}')
            raise e

redpajama_set_name: RedPajamaGithub


text:
(see http://keepachangelog.com http://semver.org)
(critical comment about semver: https://gist.github.com/jashkenas/cbd2b088e20279ae2c8e)

## Unreleased

## [0.4.2] - 2019-10-22
- Update Rusoto to version 0.41.0

## [0.4.1] - 2019-10-09
- Use `futures::stream::FuturesOrdered` to maintain the order of the merge PDFs.

## [0.4.0] - 2019-08-21
- Use `async-await`
- Replace `tide` with `warp`
- Save merge assets with V4 UUIDs as file names instead of using the original file names to avoid errors when users upload files with the same name.
- Reject merge requests with an empty list of documents to merge
- Bug fixes and cleanup

## [0.3.0] - 2018-05-11
- Add Sentry for error tracking
- Make `papers local` exit with same code as the latex process
- Send better error messages to callback endpoint
- Implement LaTeX escaping
- Force images in merges to have A4 aspect ratio *and* size
- Register `escape_tex` and `unescape_tex` filters for Tera templates
- Report both stdout and stderr in merge errors
- Trim URIs parsed for DocumentSpecs
- Merge local and server binaries

## [0.2.3] - 2017-08-31
- Add a `/merge` endpoint that takes a MergeSpec and merges documents into a
  single PDF file using `pdfunite` and ImageMagick. This is needed for merging
  PDF documents that contain forms (merging can otherwise be done simply with
  latex and `pdfpages`). In the current state, it only preserves the forms on
  the first document being merged due to limitations with available CLI tools.

## [0.2.2] - 2017-08-21
- Properly set the Content-Type header when calling the callback URL.
- Set the Content-Length header instead of Transfer-Encoding: chunked header
  when calling the callback URL. Streaming HTTP is not properly supported by
  some HTTP servers, including Puma (Rails).

## [0.2.1] - 2017-08-18
- Actually upload the workspace.tar
- Set the Content-Type header when posting to callback url
- Fix terminal output in k8s

## [0.2.0] - 2017-08-17
- Major change in the interface of the service. Papers now uploads the rendered
  PDF and the build artifact directly to an S3 bucket, which requires
  additional configuration on your part. The `callback_url` will now receive a
  `Summary`, which contains either an `error` or a `file` field with the
  presigned url to the rendered PDF, and an `s3_folder` field for the location
  of the debugging output.
- Rename all templates and merge from [name].tex to [name].tex.tera
- Better error reporting

## [0.1.0] - 2017-05-23
- Initial release


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:layout_marginBottom="60dp"
    tools:context="com.example.oukenghua.mobilephonehelper.Manage.ManageFragment">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:background="@color/colorPrimaryDark">

        <de.hdodenhof.circleimageview.CircleImageView
            android:src="@drawable/user"
            android:id="@+id/icon_image"
            android:layout_centerInParent="true"
            android:layout_width="70dp"
            android:layout_height="70dp" />

        <TextView
            android:layout_marginBottom="25dp"
            android:layout_centerHorizontal="true"
            android:id="@+id/number"
            android:text="请登录"
            android:textSize="20sp"
            android:textColor="#fff"
            android:layout_alignParentBottom="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

    </RelativeLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="40dp">

        <LinearLayout
            android:layout_marginTop="5dp"
            android:gravity="center_horizontal"
            android:layout_weight="1"
            android:layout_width="0dp"
            android:layout_height="wrap_content">

            <ImageView
                android:src="@drawable/store"
                android:layout_width="30dp"
                android:layout_height="wrap_content" />

            <TextView
                android:layout_marginLeft="5dp"
                android:layout_marginTop="8dp"
                android:textSize="16sp"
                android:text="积分商城"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />

        </LinearLayout>

        <View
            android:layout_gravity="center_vertical"
            android:layout_width="0.3dip"
            android:layout_marginTop="5dp"
            android:layout_height="match_parent"
            android:background="#696969" />

        <LinearLayout
            android:layout_marginTop="5dp"
            android:gravity="center_horizontal"
            android:layout_weight="1"
            android:layout_width="0dp"
            android:layout_height="wrap_content">

            <ImageView
                android:src="@drawable/gift"
                android:layout_width="30dp"
                android:layout_height="wrap_content" />

            <TextView
                android:layout_marginLeft="5dp"
                android:layout_marginTop="9dp"
                android:textSize="16sp"
                android:text="下载领积分"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />

        </LinearLayout>

    </LinearLayout>

    <View
        android:layout_gravity="center_vertical"
        android:layout_width="match_parent"
        android:layout_marginBottom="2dp"
        android:layout_marginTop="8dp"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="5dp"
        android:layout_height="0.3dip"
        android:background="#696969" />

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

    </android.support.v7.widget.RecyclerView>

</LinearLayout>


text:
var defaultConfig = require('./libs/coding-standards/src/lib/prettier/prettier.config.js');
module.exports = defaultConfig;


text:
<?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">
        <solid android:color="@color/login_btn_normal_color"
            />
    <size android:height="20dp" android:width="20dp"/>
    <!--<stroke android:color="@color/login_btn_normal_color"-->
        <!--android:width="36dp"-->
        <!--></stroke>-->
    </shape>


text:
// This file is automatically generated.

package adila.db;

/*
 * Motorola RAZR D3
 *
 * DEVICE: hawk40_umts
 * MODEL: XT919
 */
final class hawk405fumts_xt919 {
    public static final String DATA = "Motorola|RAZR D3|";
}


text:
package info.novatec.person.boundary;

import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.when;

import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.boot.test.OutputCapture;
import org.springframework.test.util.ReflectionTestUtils;

import info.novatec.person.entity.Person;
import info.novatec.person.repository.PersonRepository;

@RunWith(MockitoJUnitRunner.class)
public class PersonServiceTest {

	@Rule
	public OutputCapture capture = new OutputCapture();

	@Mock
	private PersonRepository personRepository;

	private PersonService cut;

	@Test
	public void verifyFindOne() {
		cut = new PersonServiceImpl();

		Person person = new Person("Hans", "Mustermann");
		ReflectionTestUtils.setField(person, "id", 1L);

		when(personRepository.findOne(1L)).thenReturn(person);

		ReflectionTestUtils.setField(cut, "personRepository", personRepository);

		Person personFound = cut.findOne(1L);

		assertThat("Should have found a valid person", personFound, is(notNullValue()));
		assertThat("Should have found person with expected id", personFound.getId(), is(1L));

		capture.expect(containsString("ReflectionTestUtils - Setting field 'personRepository'"));

	}

}


text:
/* this can't be run with mocha - so placed here and run with node*/

const periodic = require('./periodic');
const lme = require('lme');

lme.line('--');
lme.w('\nTesting periodic function. It won\'t stop until you press Ctrl+C\n');
lme.line('--');

periodic();


text:
require 'spec_helper'

describe PurchaseOrderVariant, "instance methods" do
  before(:each) do
    @inventory              = FactoryGirl.create(:inventory, :count_on_hand => 100, :count_pending_to_customer => 50)
    @variant                = FactoryGirl.create(:variant, :inventory => @inventory)
    @purchase_order_variant = FactoryGirl.create(:purchase_order_variant, :variant => @variant, :quantity => 10)
  end

  context ".receive!" do
    it 'should call receive if true' do
      @purchase_order_variant.receive!
      expect(@purchase_order_variant.variant.inventory.count_on_hand).to eq 110
    end

    it 'should mark purchase order complete' do
      @purchase_order_variant.purchase_order.expects(:mark_as_complete).once
      @purchase_order_variant.receive!
    end
  end

  context ".receive_po=(answer)" do
    it 'should call receive if true' do
      @purchase_order_variant.expects(:receive!).once
      @purchase_order_variant.receive_po=('true')
    end
    it 'should call receive if 1' do
      @purchase_order_variant.expects(:receive!).once
      @purchase_order_variant.receive_po=('1')
    end
    it 'should call receive if 0' do
      @purchase_order_variant.expects(:receive!).never
      @purchase_order_variant.receive_po=('0')
    end
  end

  context ".receive_po" do
    #is_received
    it 'should be true' do
      @purchase_order_variant.is_received = true
      expect(@purchase_order_variant.receive_po).to be true
    end

    it 'should call receive if 0' do
      @purchase_order_variant.is_received = false
      expect(@purchase_order_variant.receive_po).to be false
    end
  end
end


text:
<?php
final class Module_Language extends GWF_Module
{
	public function getVersion() { return 1.02; }
	public function isCoreModule() { return true; }
	public function getAdminSectionURL() { return $this->getMethodURL('EditFiles'); }
//	public function getDefaultPriority() { return 1; }
//	public function getDefaultAutoLoad() { return true; }
	public function getClasses() { return array('GWF_LangFile'); }
	public function onLoadLanguage() { return $this->loadLanguage('lang/lang'); }
	public function onInstall($dropTable)
	{
		require_once 'InstallLanguages.php';
		return InstallLanguages::onInstall($this, $dropTable);
	}

	public function setLanguage($iso)
	{
		if (false === ($lang = GWF_Language::getByISO($iso))) {
			return false;
		}
		GWF_Language::setCurrentLanguage($lang);
		return true;
	}

	public function getSwitchLangSelect()
	{
		$langs = GWF_Language::getSupportedLanguages();
		$data = array();
		foreach ($langs as $lang)
		{
			$data[] = array($lang->displayName(), $lang->getISO());
		}
		$current_iso = GWF_Language::getCurrentISO();
		$onchange = "window.location=GWF_WEB_ROOT+'lang-to-'+this.value;";
		return GWF_Select::display('switch_lang', $data, $current_iso, $onchange);
	}

	public static function getSwitchLangSelectDomain()
	{
		$langs = GWF_Language::getSupportedLanguages();
		$data = array();
		foreach ($langs as $lang)
		{
			$data[] = array($lang->displayName(), $lang->getISO());
		}
		$current_iso = GWF_Language::getCurrentISO();
		$domain = GWF_DOMAIN;
		$url = htmlspecialchars($_SERVER['REQUEST_URI']);
		$onchange = "window.location='http://'+this.value+'.$domain$url';";
		return GWF_Select::display('switch_lang', $data, $current_iso, $onchange);
	}
}
?>


text:
    <title></title>
    <link rel="stylesheet" href="resources/stylesheet.php">

        Test for http://bugs.webkit.org/show_bug.cgi?id=11451
        REGRESSION: Dell.com does not render correctly in ToT (stylesheet not loaded).


text:
function Blend_reports(results_loc,  base_name , Author, Graphic_path)
%Blends some of the output from the individual thermal analysis reports to
%generate a summary comparison report.
%
% Example: Blend_reports( rep_title, base_name , Author, Graphic_path)

[names,~] = dir_list_gen(results_loc, 'dirs', 1);
%select only those folders whos names start with the base name.
names = names(strncmp(names, base_name, length(base_name)));
base_name_ind = find(strcmp(names, base_name) == 1);
if isempty(base_name_ind)
    base_name_ind = find(strcmp(names, [base_name, '_Base']) == 1);
end %if

tmp=regexprep(names, base_name, '');
tmp(base_name_ind) = [];
tmp2 = strfind(tmp, '_');
for awk = 1:length(tmp2)
    if isempty(tmp2{awk})
        tmp3{awk} = [];
    else
        tmp3{awk} = tmp{awk}(tmp2{awk}(1) +1:tmp2{awk}(end) -1);
    end %if
end %for
if length(tmp2) > 0
    sweeps = unique(tmp3);
else
    sweeps = [];
end %if

for ewh = 1:length(sweeps)
    sweep_ind = find_position_in_cell_lst(strfind(names,sweeps{ewh}));
    names_in_sweep = names([base_name_ind, sweep_ind]);
    good_data = ones(length(names_in_sweep),1);
    for psw = length(names_in_sweep):-1:1
        try
            load(fullfile(results_loc, names_in_sweep{psw},'wake','run_inputs.mat'))
            load(fullfile(results_loc, names_in_sweep{psw}, 'wake', 'data_from_run_logs.mat'))
            [sim_param_names_tmp, sim_param_vals_tmp, ...
                geom_param_names_tmp, geom_param_vals_tmp] = extract_parameters(run_logs);
        catch
            try
                load(fullfile(results_loc, names_in_sweep{psw}, 's_parameter', 'data_from_run_logs.mat'))
                load(fullfile(results_loc, names_in_sweep{psw},'s_parameter','run_inputs.mat'))
                [sim_param_names_tmp, sim_param_vals_tmp, ...
                    geom_param_names_tmp, geom_param_vals_tmp] = extract_parameters(run_logs);

            catch
                warning(['No data files found for ', names_in_sweep{psw}])
                good_data(psw) = 0;
                continue
            end %try
        end %try
        param_names_tmp = cat(2,sim_param_names_tmp, geom_param_names_tmp, 'geometry_fraction');
        param_vals_tmp = cat(2,sim_param_vals_tmp, geom_param_vals_tmp, modelling_inputs.geometry_fraction);

        %     model_names{psw} =  regexprep(modelling_inputs.('model_name'),'_',' ');
        param_names(psw,1:length(param_names_tmp)) = regexprep(param_names_tmp,'_',' ');
        for ns = 1:length(param_vals_tmp)
            if ~ischar(param_vals_tmp{ns})
                param_vals_tmp{ns} = num2str(param_vals_tmp{ns});
            end %if
        end %for
        param_vals(psw,1:length(param_vals_tmp)) = param_vals_tmp;
    end %for
    if sum(good_data) ==0
        warning('No valid data. Skipping report generation')
        return
    end %if

    % Find the total list of parameters and reorganise the values to fit this
    % global list.
    param_name_list = unique(param_names(good_data ==1,:));
    param_val_list = cell(size(param_names,1), length(param_name_list));
    for ias = 1:size(param_names, 1)
        for iaw = 1:length(param_name_list)
            [~,c] = find(strcmp(param_name_list{iaw}, param_names(ias,:)));
            if isempty(c)
                param_val_list{ias,iaw} = [];
            else
                param_val_list{ias,iaw} = param_vals{ias, c};
            end %if
        end %for
    end %for

    % Identify which parameters vary.
    param_val_list_good = param_val_list(good_data ==1,:);
    for sha = size(param_val_list_good,2):-1:1
        stable(sha) = all(strcmp(param_val_list_good{1,sha},param_val_list_good(:,sha)));
    end %for
    varying_pars_ind = find(stable ==0);
    if length(varying_pars_ind) >1
        warning('More than one variable changing during the sweep. Only using the first one.')
    end %if
    if isempty(varying_pars_ind)
        warning('No varying parameters found. Skipping this one.')
        return
    end %if

    isn =1;
    %select a single vaying parameter.
    stable_tmp = true(length(stable), 1);
    stable_tmp(varying_pars_ind(isn)) = 0;
    %     report_name = regexprep(rep_title,'_', ' ');
    report_input.author = Author;
    report_input.date = datestr(now,'dd/mm/yyyy');
    report_input.base_name = base_name;
    report_input.source_path = results_loc;
    report_input.graphic = Graphic_path;
    report_input.param_names_common = param_name_list(stable_tmp);
    report_input.param_vals_common = param_val_list(base_name_ind, stable_tmp);
    report_input.swept_name = param_name_list(~stable_tmp);
    report_input.good_data = good_data;
    report_input.sources = names_in_sweep;
    report_input.swept_vals = param_val_list(:,~stable_tmp);

    % add some values from the input file which do not show in the
    % postprocessing log.
    if isfield(modelling_inputs, 'port_multiple')
        report_input.port_multiple = modelling_inputs.port_multiple;
        report_input.port_fill_factor = modelling_inputs.port_fill_factor;
        report_input.volume_fill_factor = modelling_inputs.volume_fill_factor;
    end %if
    % replace all spaces with _ as latex has problems with spaces.
    model_name_for_report = regexprep(base_name, '_', ' ');
    report_input.report_name = [model_name_for_report, ' - ',report_input.swept_name{isn},' sweep' ];
    report_input.rep_title = [report_input.swept_name{isn},'_sweep','-',base_name ];
    report_input.doc_num = [model_name_for_report, '\\',report_input.swept_name{isn},' sweep' ];
    report_input.output_loc = fullfile(results_loc, report_input.rep_title);

    if ~exist(report_input.output_loc, 'dir')
        mkdir(report_input.output_loc)
    end %if
    Blend_single_report(report_input)
    clear param_names param_vals
end %for


text:
layout: doc
title: "ViewContext.view"
position: 0
---

Возвращает [представление](../../Elements/View/) контекста.

# Syntax

```js
ViewContext.view
```

# Examples

```js
var view = ViewContext.view;
```

# See Also

* [`View`](../../Elements/View/)


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2018.02.17 at 03:24:36 PM CET
//

package no.api.meteo.jaxb.locationforecast.v1_9;

import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;

/**
 * This object contains factory methods for each
 * Java content interface and Java element interface
 * generated in the no.api.meteo.jaxb.locationforecast.v1_9 package.
 *
An ObjectFactory allows you to programatically
 * construct new instances of the Java representation
 * for XML content. The Java representation of XML
 * content can consist of schema derived interfaces
 * and classes representing the binding of schema
 * type definitions, element declarations and model
 * groups.  Factory methods for each of these are
 * provided in this class.
 *
 */
@XmlRegistry
public class ObjectFactory {

    private final static QName _LocationTypeMaxTemperature_QNAME = new QName("", "maxTemperature");
    private final static QName _LocationTypeSymbol_QNAME = new QName("", "symbol");
    private final static QName _LocationTypeHighestTemperature_QNAME = new QName("", "highestTemperature");
    private final static QName _LocationTypeWindGust_QNAME = new QName("", "windGust");
    private final static QName _LocationTypeCurrentDirection_QNAME = new QName("", "currentDirection");
    private final static QName _LocationTypeStateOfTheSea_QNAME = new QName("", "stateOfTheSea");
    private final static QName _LocationTypeMeanabsoluteerror_QNAME = new QName("", "meanabsoluteerror");
    private final static QName _LocationTypeMaximumPrecipitation_QNAME = new QName("", "maximumPrecipitation");
    private final static QName _LocationTypeTidalwater_QNAME = new QName("", "tidalwater");
    private final static QName _LocationTypeWaveHeight_QNAME = new QName("", "waveHeight");
    private final static QName _LocationTypePrecipitation_QNAME = new QName("", "precipitation");
    private final static QName _LocationTypeScore_QNAME = new QName("", "score");
    private final static QName _LocationTypeAreaMaxWindSpeed_QNAME = new QName("", "areaMaxWindSpeed");
    private final static QName _LocationTypeSnowDepth_QNAME = new QName("", "snowDepth");
    private final static QName _LocationTypeLowClouds_QNAME = new QName("", "lowClouds");
    private final static QName _LocationTypeMinTemperature_QNAME = new QName("", "minTemperature");
    private final static QName _LocationTypeBias_QNAME = new QName("", "bias");
    private final static QName _LocationTypeTemperature_QNAME = new QName("", "temperature");
    private final static QName _LocationTypeWeather_QNAME = new QName("", "weather");
    private final static QName _LocationTypeHumidity_QNAME = new QName("", "humidity");
    private final static QName _LocationTypeNumberofobservations_QNAME = new QName("", "numberofobservations");
    private final static QName _LocationTypeWindDirection_QNAME = new QName("", "windDirection");
    private final static QName _LocationTypeMaxTemperatureDay_QNAME = new QName("", "maxTemperatureDay");
    private final static QName _LocationTypeWindSpeed_QNAME = new QName("", "windSpeed");
    private final static QName _LocationTypeWavePeriod_QNAME = new QName("", "wavePeriod");
    private final static QName _LocationTypeMinTemperatureNight_QNAME = new QName("", "minTemperatureNight");
    private final static QName _LocationTypeUv_QNAME = new QName("", "uv");
    private final static QName _LocationTypeHighClouds_QNAME = new QName("", "highClouds");
    private final static QName _LocationTypeMaxTemperatureNight_QNAME = new QName("", "maxTemperatureNight");
    private final static QName _LocationTypeWindProbability_QNAME = new QName("", "windProbability");
    private final static QName _LocationTypeMaxWaveHeight_QNAME = new QName("", "maxWaveHeight");
    private final static QName _LocationTypeSurfaceTemperature_QNAME = new QName("", "surfaceTemperature");
    private final static QName _LocationTypePressure_QNAME = new QName("", "pressure");
    private final static QName _LocationTypeCloudiness_QNAME = new QName("", "cloudiness");
    private final static QName _LocationTypeWaveDirection_QNAME = new QName("", "waveDirection");
    private final static QName _LocationTypeSymbolProbability_QNAME = new QName("", "symbolProbability");
    private final static QName _LocationTypeTemperatureProbability_QNAME = new QName("", "temperatureProbability");
    private final static QName _LocationTypeGroundCover_QNAME = new QName("", "groundCover");
    private final static QName _LocationTypeMinTemperatureDay_QNAME = new QName("", "minTemperatureDay");
    private final static QName _LocationTypeMaxWindSpeed_QNAME = new QName("", "maxWindSpeed");
    private final static QName _LocationTypeForestFire_QNAME = new QName("", "forest-fire");
    private final static QName _LocationTypeMediumClouds_QNAME = new QName("", "mediumClouds");
    private final static QName _LocationTypeDewpointTemperature_QNAME = new QName("", "dewpointTemperature");
    private final static QName _LocationTypeLowestTemperature_QNAME = new QName("", "lowestTemperature");
    private final static QName _LocationTypeFog_QNAME = new QName("", "fog");

    /**
     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: no.api.meteo.jaxb.locationforecast.v1_9
     *
     */
    public ObjectFactory() {
    }

    /**
     * Create an instance of {@link LocationType }
     *
     */
    public LocationType createLocationType() {
        return new LocationType();
    }

    /**
     * Create an instance of {@link Weatherdata }
     *
     */
    public Weatherdata createWeatherdata() {
        return new Weatherdata();
    }

    /**
     * Create an instance of {@link MetaType }
     *
     */
    public MetaType createMetaType() {
        return new MetaType();
    }

    /**
     * Create an instance of {@link ProductType }
     *
     */
    public ProductType createProductType() {
        return new ProductType();
    }

    /**
     * Create an instance of {@link Uv }
     *
     */
    public Uv createUv() {
        return new Uv();
    }

    /**
     * Create an instance of {@link TimeType }
     *
     */
    public TimeType createTimeType() {
        return new TimeType();
    }

    /**
     * Create an instance of {@link ModelType }
     *
     */
    public ModelType createModelType() {
        return new ModelType();
    }

    /**
     * Create an instance of {@link Cloudiness }
     *
     */
    public Cloudiness createCloudiness() {
        return new Cloudiness();
    }

    /**
     * Create an instance of {@link Pressure }
     *
     */
    public Pressure createPressure() {
        return new Pressure();
    }

    /**
     * Create an instance of {@link Tidalwater }
     *
     */
    public Tidalwater createTidalwater() {
        return new Tidalwater();
    }

    /**
     * Create an instance of {@link Precipitation }
     *
     */
    public Precipitation createPrecipitation() {
        return new Precipitation();
    }

    /**
     * Create an instance of {@link Score }
     *
     */
    public Score createScore() {
        return new Score();
    }

    /**
     * Create an instance of {@link Groundcover }
     *
     */
    public Groundcover createGroundcover() {
        return new Groundcover();
    }

    /**
     * Create an instance of {@link Temperature }
     *
     */
    public Temperature createTemperature() {
        return new Temperature();
    }

    /**
     * Create an instance of {@link Windspeed }
     *
     */
    public Windspeed createWindspeed() {
        return new Windspeed();
    }

    /**
     * Create an instance of {@link UnitValue }
     *
     */
    public UnitValue createUnitValue() {
        return new UnitValue();
    }

    /**
     * Create an instance of {@link LocationType.WindDirection }
     *
     */
    public LocationType.WindDirection createLocationTypeWindDirection() {
        return new LocationType.WindDirection();
    }

    /**
     * Create an instance of {@link LocationType.StateOfTheSea }
     *
     */
    public LocationType.StateOfTheSea createLocationTypeStateOfTheSea() {
        return new LocationType.StateOfTheSea();
    }

    /**
     * Create an instance of {@link LocationType.SnowDepth }
     *
     */
    public LocationType.SnowDepth createLocationTypeSnowDepth() {
        return new LocationType.SnowDepth();
    }

    /**
     * Create an instance of {@link LocationType.Weather }
     *
     */
    public LocationType.Weather createLocationTypeWeather() {
        return new LocationType.Weather();
    }

    /**
     * Create an instance of {@link LocationType.Symbol }
     *
     */
    public LocationType.Symbol createLocationTypeSymbol() {
        return new LocationType.Symbol();
    }

    /**
     * Create an instance of {@link LocationType.ForestFire }
     *
     */
    public LocationType.ForestFire createLocationTypeForestFire() {
        return new LocationType.ForestFire();
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Temperature }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "maxTemperature", scope = LocationType.class)
    public JAXBElement<Temperature> createLocationTypeMaxTemperature(Temperature value) {
        return new JAXBElement<Temperature>(_LocationTypeMaxTemperature_QNAME, Temperature.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link LocationType.Symbol }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "symbol", scope = LocationType.class)
    public JAXBElement<LocationType.Symbol> createLocationTypeSymbol(LocationType.Symbol value) {
        return new JAXBElement<LocationType.Symbol>(_LocationTypeSymbol_QNAME, LocationType.Symbol.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Temperature }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "highestTemperature", scope = LocationType.class)
    public JAXBElement<Temperature> createLocationTypeHighestTemperature(Temperature value) {
        return new JAXBElement<Temperature>(_LocationTypeHighestTemperature_QNAME, Temperature.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Windspeed }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "windGust", scope = LocationType.class)
    public JAXBElement<Windspeed> createLocationTypeWindGust(Windspeed value) {
        return new JAXBElement<Windspeed>(_LocationTypeWindGust_QNAME, Windspeed.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link UnitValue }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "currentDirection", scope = LocationType.class)
    public JAXBElement<UnitValue> createLocationTypeCurrentDirection(UnitValue value) {
        return new JAXBElement<UnitValue>(_LocationTypeCurrentDirection_QNAME, UnitValue.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link LocationType.StateOfTheSea }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "stateOfTheSea", scope = LocationType.class)
    public JAXBElement<LocationType.StateOfTheSea> createLocationTypeStateOfTheSea(LocationType.StateOfTheSea value) {
        return new JAXBElement<LocationType.StateOfTheSea>(_LocationTypeStateOfTheSea_QNAME, LocationType.StateOfTheSea.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link UnitValue }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "meanabsoluteerror", scope = LocationType.class)
    public JAXBElement<UnitValue> createLocationTypeMeanabsoluteerror(UnitValue value) {
        return new JAXBElement<UnitValue>(_LocationTypeMeanabsoluteerror_QNAME, UnitValue.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Precipitation }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "maximumPrecipitation", scope = LocationType.class)
    public JAXBElement<Precipitation> createLocationTypeMaximumPrecipitation(Precipitation value) {
        return new JAXBElement<Precipitation>(_LocationTypeMaximumPrecipitation_QNAME, Precipitation.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Tidalwater }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "tidalwater", scope = LocationType.class)
    public JAXBElement<Tidalwater> createLocationTypeTidalwater(Tidalwater value) {
        return new JAXBElement<Tidalwater>(_LocationTypeTidalwater_QNAME, Tidalwater.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link UnitValue }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "waveHeight", scope = LocationType.class)
    public JAXBElement<UnitValue> createLocationTypeWaveHeight(UnitValue value) {
        return new JAXBElement<UnitValue>(_LocationTypeWaveHeight_QNAME, UnitValue.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Precipitation }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "precipitation", scope = LocationType.class)
    public JAXBElement<Precipitation> createLocationTypePrecipitation(Precipitation value) {
        return new JAXBElement<Precipitation>(_LocationTypePrecipitation_QNAME, Precipitation.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Score }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "score", scope = LocationType.class)
    public JAXBElement<Score> createLocationTypeScore(Score value) {
        return new JAXBElement<Score>(_LocationTypeScore_QNAME, Score.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Windspeed }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "areaMaxWindSpeed", scope = LocationType.class)
    public JAXBElement<Windspeed> createLocationTypeAreaMaxWindSpeed(Windspeed value) {
        return new JAXBElement<Windspeed>(_LocationTypeAreaMaxWindSpeed_QNAME, Windspeed.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link LocationType.SnowDepth }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "snowDepth", scope = LocationType.class)
    public JAXBElement<LocationType.SnowDepth> createLocationTypeSnowDepth(LocationType.SnowDepth value) {
        return new JAXBElement<LocationType.SnowDepth>(_LocationTypeSnowDepth_QNAME, LocationType.SnowDepth.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Cloudiness }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "lowClouds", scope = LocationType.class)
    public JAXBElement<Cloudiness> createLocationTypeLowClouds(Cloudiness value) {
        return new JAXBElement<Cloudiness>(_LocationTypeLowClouds_QNAME, Cloudiness.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Temperature }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "minTemperature", scope = LocationType.class)
    public JAXBElement<Temperature> createLocationTypeMinTemperature(Temperature value) {
        return new JAXBElement<Temperature>(_LocationTypeMinTemperature_QNAME, Temperature.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link UnitValue }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "bias", scope = LocationType.class)
    public JAXBElement<UnitValue> createLocationTypeBias(UnitValue value) {
        return new JAXBElement<UnitValue>(_LocationTypeBias_QNAME, UnitValue.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Temperature }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "temperature", scope = LocationType.class)
    public JAXBElement<Temperature> createLocationTypeTemperature(Temperature value) {
        return new JAXBElement<Temperature>(_LocationTypeTemperature_QNAME, Temperature.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link LocationType.Weather }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "weather", scope = LocationType.class)
    public JAXBElement<LocationType.Weather> createLocationTypeWeather(LocationType.Weather value) {
        return new JAXBElement<LocationType.Weather>(_LocationTypeWeather_QNAME, LocationType.Weather.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link UnitValue }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "humidity", scope = LocationType.class)
    public JAXBElement<UnitValue> createLocationTypeHumidity(UnitValue value) {
        return new JAXBElement<UnitValue>(_LocationTypeHumidity_QNAME, UnitValue.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link UnitValue }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "numberofobservations", scope = LocationType.class)
    public JAXBElement<UnitValue> createLocationTypeNumberofobservations(UnitValue value) {
        return new JAXBElement<UnitValue>(_LocationTypeNumberofobservations_QNAME, UnitValue.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link LocationType.WindDirection }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "windDirection", scope = LocationType.class)
    public JAXBElement<LocationType.WindDirection> createLocationTypeWindDirection(LocationType.WindDirection value) {
        return new JAXBElement<LocationType.WindDirection>(_LocationTypeWindDirection_QNAME, LocationType.WindDirection.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Temperature }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "maxTemperatureDay", scope = LocationType.class)
    public JAXBElement<Temperature> createLocationTypeMaxTemperatureDay(Temperature value) {
        return new JAXBElement<Temperature>(_LocationTypeMaxTemperatureDay_QNAME, Temperature.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Windspeed }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "windSpeed", scope = LocationType.class)
    public JAXBElement<Windspeed> createLocationTypeWindSpeed(Windspeed value) {
        return new JAXBElement<Windspeed>(_LocationTypeWindSpeed_QNAME, Windspeed.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link UnitValue }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "wavePeriod", scope = LocationType.class)
    public JAXBElement<UnitValue> createLocationTypeWavePeriod(UnitValue value) {
        return new JAXBElement<UnitValue>(_LocationTypeWavePeriod_QNAME, UnitValue.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Temperature }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "minTemperatureNight", scope = LocationType.class)
    public JAXBElement<Temperature> createLocationTypeMinTemperatureNight(Temperature value) {
        return new JAXBElement<Temperature>(_LocationTypeMinTemperatureNight_QNAME, Temperature.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Uv }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "uv", scope = LocationType.class)
    public JAXBElement<Uv> createLocationTypeUv(Uv value) {
        return new JAXBElement<Uv>(_LocationTypeUv_QNAME, Uv.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Cloudiness }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "highClouds", scope = LocationType.class)
    public JAXBElement<Cloudiness> createLocationTypeHighClouds(Cloudiness value) {
        return new JAXBElement<Cloudiness>(_LocationTypeHighClouds_QNAME, Cloudiness.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Temperature }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "maxTemperatureNight", scope = LocationType.class)
    public JAXBElement<Temperature> createLocationTypeMaxTemperatureNight(Temperature value) {
        return new JAXBElement<Temperature>(_LocationTypeMaxTemperatureNight_QNAME, Temperature.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link UnitValue }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "windProbability", scope = LocationType.class)
    public JAXBElement<UnitValue> createLocationTypeWindProbability(UnitValue value) {
        return new JAXBElement<UnitValue>(_LocationTypeWindProbability_QNAME, UnitValue.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link UnitValue }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "maxWaveHeight", scope = LocationType.class)
    public JAXBElement<UnitValue> createLocationTypeMaxWaveHeight(UnitValue value) {
        return new JAXBElement<UnitValue>(_LocationTypeMaxWaveHeight_QNAME, UnitValue.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link UnitValue }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "surfaceTemperature", scope = LocationType.class)
    public JAXBElement<UnitValue> createLocationTypeSurfaceTemperature(UnitValue value) {
        return new JAXBElement<UnitValue>(_LocationTypeSurfaceTemperature_QNAME, UnitValue.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Pressure }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "pressure", scope = LocationType.class)
    public JAXBElement<Pressure> createLocationTypePressure(Pressure value) {
        return new JAXBElement<Pressure>(_LocationTypePressure_QNAME, Pressure.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Cloudiness }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "cloudiness", scope = LocationType.class)
    public JAXBElement<Cloudiness> createLocationTypeCloudiness(Cloudiness value) {
        return new JAXBElement<Cloudiness>(_LocationTypeCloudiness_QNAME, Cloudiness.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link UnitValue }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "waveDirection", scope = LocationType.class)
    public JAXBElement<UnitValue> createLocationTypeWaveDirection(UnitValue value) {
        return new JAXBElement<UnitValue>(_LocationTypeWaveDirection_QNAME, UnitValue.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link UnitValue }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "symbolProbability", scope = LocationType.class)
    public JAXBElement<UnitValue> createLocationTypeSymbolProbability(UnitValue value) {
        return new JAXBElement<UnitValue>(_LocationTypeSymbolProbability_QNAME, UnitValue.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link UnitValue }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "temperatureProbability", scope = LocationType.class)
    public JAXBElement<UnitValue> createLocationTypeTemperatureProbability(UnitValue value) {
        return new JAXBElement<UnitValue>(_LocationTypeTemperatureProbability_QNAME, UnitValue.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Groundcover }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "groundCover", scope = LocationType.class)
    public JAXBElement<Groundcover> createLocationTypeGroundCover(Groundcover value) {
        return new JAXBElement<Groundcover>(_LocationTypeGroundCover_QNAME, Groundcover.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Temperature }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "minTemperatureDay", scope = LocationType.class)
    public JAXBElement<Temperature> createLocationTypeMinTemperatureDay(Temperature value) {
        return new JAXBElement<Temperature>(_LocationTypeMinTemperatureDay_QNAME, Temperature.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Windspeed }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "maxWindSpeed", scope = LocationType.class)
    public JAXBElement<Windspeed> createLocationTypeMaxWindSpeed(Windspeed value) {
        return new JAXBElement<Windspeed>(_LocationTypeMaxWindSpeed_QNAME, Windspeed.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link LocationType.ForestFire }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "forest-fire", scope = LocationType.class)
    public JAXBElement<LocationType.ForestFire> createLocationTypeForestFire(LocationType.ForestFire value) {
        return new JAXBElement<LocationType.ForestFire>(_LocationTypeForestFire_QNAME, LocationType.ForestFire.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Cloudiness }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "mediumClouds", scope = LocationType.class)
    public JAXBElement<Cloudiness> createLocationTypeMediumClouds(Cloudiness value) {
        return new JAXBElement<Cloudiness>(_LocationTypeMediumClouds_QNAME, Cloudiness.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Temperature }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "dewpointTemperature", scope = LocationType.class)
    public JAXBElement<Temperature> createLocationTypeDewpointTemperature(Temperature value) {
        return new JAXBElement<Temperature>(_LocationTypeDewpointTemperature_QNAME, Temperature.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Temperature }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "lowestTemperature", scope = LocationType.class)
    public JAXBElement<Temperature> createLocationTypeLowestTemperature(Temperature value) {
        return new JAXBElement<Temperature>(_LocationTypeLowestTemperature_QNAME, Temperature.class, LocationType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Cloudiness }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "", name = "fog", scope = LocationType.class)
    public JAXBElement<Cloudiness> createLocationTypeFog(Cloudiness value) {
        return new JAXBElement<Cloudiness>(_LocationTypeFog_QNAME, Cloudiness.class, LocationType.class, value);
    }

}


text:
import ddt
import mock

from cinder import context
from cinder import exception
from cinder.tests.unit import fake_volume
from cinder.tests.unit.volume.drivers.emc import scaleio

@ddt.ddt
class TestCreateVolume(scaleio.TestScaleIODriver):
    """Test cases for ``ScaleIODriver.create_volume()``"""
    def setUp(self):
        """Setup a test case environment.

        Creates a fake volume object and sets up the required API responses.
        """
        super(TestCreateVolume, self).setUp()
        ctx = context.RequestContext('fake', 'fake', auth_token=True)

        self.volume = fake_volume.fake_volume_obj(ctx)

        self.HTTPS_MOCK_RESPONSES = {
            self.RESPONSE_MODE.Valid: {
                'types/Volume/instances/getByName::' +
                self.volume.name: '"{}"'.format(self.volume.id),
                'types/Volume/instances': {'id': self.volume.id},
                'types/Domain/instances/getByName::' +
                self.PROT_DOMAIN_NAME:
                    '"{}"'.format(self.PROT_DOMAIN_ID),
                'types/Pool/instances/getByName::{},{}'.format(
                    self.PROT_DOMAIN_ID,
                    self.STORAGE_POOL_NAME
                ): '"{}"'.format(self.STORAGE_POOL_ID),
            },
            self.RESPONSE_MODE.Invalid: {
                'types/Domain/instances/getByName::' +
                self.PROT_DOMAIN_NAME: None,
                'types/Pool/instances/getByName::{},{}'.format(
                    self.PROT_DOMAIN_ID,
                    self.STORAGE_POOL_NAME
                ): None,
            },
            self.RESPONSE_MODE.BadStatus: {
                'types/Volume/instances': self.BAD_STATUS_RESPONSE,
                'types/Domain/instances/getByName::' +
                self.PROT_DOMAIN_NAME: self.BAD_STATUS_RESPONSE,
                'types/Pool/instances/getByName::{},{}'.format(
                    self.PROT_DOMAIN_ID,
                    self.STORAGE_POOL_NAME
                ): self.BAD_STATUS_RESPONSE,
            },
        }

    def test_no_domain(self):
        """No protection domain name or ID provided."""
        self.driver.protection_domain_name = None
        self.driver.protection_domain_id = None
        self.assertRaises(exception.VolumeBackendAPIException,
                          self.test_create_volume)

    def test_no_domain_id(self):
        """Only protection domain name provided."""
        self.driver.protection_domain_id = None
        self.driver.protection_domain_name = self.PROT_DOMAIN_NAME
        self.driver.storage_pool_name = None
        self.driver.storage_pool_id = self.STORAGE_POOL_ID
        self.test_create_volume()

    def test_no_domain_id_invalid_response(self):
        self.set_https_response_mode(self.RESPONSE_MODE.Invalid)
        self.assertRaises(exception.VolumeBackendAPIException,
                          self.test_no_domain_id)

    def test_no_domain_id_badstatus_response(self):
        self.set_https_response_mode(self.RESPONSE_MODE.BadStatus)
        self.assertRaises(exception.VolumeBackendAPIException,
                          self.test_no_domain_id)

    def test_no_storage_id(self):
        """Only protection domain name provided."""
        self.driver.storage_pool_id = None
        self.driver.storage_pool_name = self.STORAGE_POOL_NAME
        self.driver.protection_domain_id = self.PROT_DOMAIN_ID
        self.driver.protection_domain_name = None
        self.test_create_volume()

    def test_no_storage_id_invalid_response(self):
        self.set_https_response_mode(self.RESPONSE_MODE.Invalid)
        self.assertRaises(exception.VolumeBackendAPIException,
                          self.test_no_storage_id)

    def test_no_storage_id_badstatus_response(self):
        self.set_https_response_mode(self.RESPONSE_MODE.BadStatus)
        self.assertRaises(exception.VolumeBackendAPIException,
                          self.test_no_storage_id)

    def test_create_volume(self):
        """Valid create volume parameters"""
        self.driver.create_volume(self.volume)

    def test_create_volume_non_8_gran(self):
        self.volume.size = 14
        model_update = self.driver.create_volume(self.volume)
        self.assertEqual(16, model_update['size'])

    def test_create_volume_badstatus_response(self):
        self.set_https_response_mode(self.RESPONSE_MODE.BadStatus)
        self.assertRaises(exception.VolumeBackendAPIException,
                          self.test_create_volume)

    @ddt.data({'provisioning:type': 'thin'}, {'provisioning:type': 'thin'})
    def test_create_thin_thick_volume(self, extraspecs):
        self.driver._get_volumetype_extraspecs = mock.MagicMock()
        self.driver._get_volumetype_extraspecs.return_value = extraspecs
        self.driver.create_volume(self.volume)

    def test_create_volume_bad_provisioning_type(self):
        extraspecs = {'provisioning:type': 'other'}
        self.driver._get_volumetype_extraspecs = mock.MagicMock()
        self.driver._get_volumetype_extraspecs.return_value = extraspecs
        self.assertRaises(exception.VolumeBackendAPIException,
                          self.test_create_volume)