# Path: netvisor/exc.py
# class InvalidData(NetvisorError):
#     pass
# 
# Path: tests/utils.py
# def get_request_content(filename):
#     filename = os.path.join(get_requests_dir(), filename)
#     return read_file(filename)
# 
# def get_response_content(filename):
#     filename = os.path.join(get_responses_dir(), filename)
#     return read_file(filename)


import decimal
import pytest
from datetime import date
from marshmallow import ValidationError
from netvisor.exc import InvalidData
from ..utils import get_request_content, get_response_content
                    'identifier': u'OMENA',
                    'name': u'Omena',
                    'unit_price': decimal.Decimal('6.9000'),
                    'vat_percentage': {
                        'percentage': decimal.Decimal('22'),
                        'code': u'KOMY',
                    },
                    'quantity': decimal.Decimal('2'),
                    'discount_percentage': decimal.Decimal('0'),
                    'free_text': None,
                    'vat_sum': decimal.Decimal('3.04'),
                    'sum': decimal.Decimal('16.84'),
                    'accounting_account_suggestion': None,
                }
            ]
        }

    def test_get_raises_error_if_sales_invoice_not_found(
        self, netvisor, responses
    ):
        responses.add(
            method='GET',
            url=(
                'http://koulutus.netvisor.fi/GetSalesInvoice.nv?'
                'NetvisorKey=123'
            ),
            body=get_response_content('GetSalesInvoiceNotFound.xml'),
            content_type='text/html; charset=utf-8',
            match_querystring=True
        )

# Path: netvisor/exc.py
# class InvalidData(NetvisorError):
#     pass
# 
# Path: tests/utils.py
# def get_request_content(filename):
#     filename = os.path.join(get_requests_dir(), filename)
#     return read_file(filename)
# 
# def get_response_content(filename):
#     filename = os.path.join(get_responses_dir(), filename)
#     return read_file(filename)


# Path: tests/services/test_sales_invoice.py
import decimal
import pytest
from datetime import date
from marshmallow import ValidationError
from netvisor.exc import InvalidData
from ..utils import get_request_content, get_response_content

                    'identifier': u'OMENA',
                    'name': u'Omena',
                    'unit_price': decimal.Decimal('6.9000'),
                    'vat_percentage': {
                        'percentage': decimal.Decimal('22'),
                        'code': u'KOMY',
                    },
                    'quantity': decimal.Decimal('2'),
                    'discount_percentage': decimal.Decimal('0'),
                    'free_text': None,
                    'vat_sum': decimal.Decimal('3.04'),
                    'sum': decimal.Decimal('16.84'),
                    'accounting_account_suggestion': None,
                }
            ]
        }

    def test_get_raises_error_if_sales_invoice_not_found(
        self, netvisor, responses
    ):
        responses.add(
            method='GET',
            url=(
                'http://koulutus.netvisor.fi/GetSalesInvoice.nv?'
                'NetvisorKey=123'
            ),
            body=get_response_content('GetSalesInvoiceNotFound.xml'),
            content_type='text/html; charset=utf-8',
            match_querystring=True
        )

        with pytest.raises(InvalidData) as excinfo: