# Path: segno/helpers.py
# _MECARD_ESCAPE = {
#     ord('\\'): "\\\\",
#     ord(';'): "\\;",
#     ord(':'): "\\:",
#     ord('"'): '\\"',
# }
# _VCARD_ESCAPE = {
#     ord(','): '\\,',
#     ord(';'): '\\;',
# }
# def _escape_mecard(s):
# def _escape_vcard(s):
# def make_wifi_data(ssid, password=None, security=None, hidden=False):
# def make_wifi(ssid, password=None, security=None, hidden=False):
# def make_mecard_data(name, reading=None, email=None, phone=None, videophone=None,
#                      memo=None, nickname=None, birthday=None, url=None,
#                      pobox=None, roomno=None, houseno=None, city=None,
#                      prefecture=None, zipcode=None, country=None):
#     def make_multifield(name, val):
# def make_mecard(name, reading=None, email=None, phone=None, videophone=None,
#                 memo=None, nickname=None, birthday=None, url=None, pobox=None,
#                 roomno=None, houseno=None, city=None, prefecture=None,
#                 zipcode=None, country=None):
# def make_vcard_data(name, displayname, email=None, phone=None, fax=None,
#                     videophone=None, memo=None, nickname=None, birthday=None,
#                     url=None, pobox=None, street=None, city=None, region=None,
#                     zipcode=None, country=None, org=None, lat=None, lng=None,
#                     source=None, rev=None, title=None, photo_uri=None):
#     def make_multifield(name, val):
# def make_vcard(name, displayname, email=None, phone=None, fax=None,
#                videophone=None, memo=None, nickname=None, birthday=None,
#                url=None, pobox=None, street=None, city=None, region=None,
#                zipcode=None, country=None, org=None, lat=None, lng=None,
#                source=None, rev=None, title=None, photo_uri=None):
# def make_geo_data(lat, lng):
#     def float_to_str(f):
# def make_geo(lat, lng):
# def make_make_email_data(to, cc=None, bcc=None, subject=None, body=None):
#     def multi(val):
# def make_email(to, cc=None, bcc=None, subject=None, body=None):
# def _make_epc_qr_data(name, iban, amount, text=None, reference=None, bic=None,
#                       purpose=None, encoding=None):
# def make_epc_qr(name, iban, amount, text=None, reference=None, bic=None,
#                 purpose=None, encoding=None):


import pytest
import segno
from segno import helpers
from datetime import date
def test_vcard_data_invalid_rev(rev):
    with pytest.raises(ValueError):
        helpers.make_vcard_data('Mustermann;Max', 'Max Mustermann', rev=rev)


def test_vcard_data_invalid_geo():
    with pytest.raises(ValueError):
        helpers.make_vcard_data('Mustermann;Max', 'Max Mustermann', lat=1.234)
    with pytest.raises(ValueError):
        helpers.make_vcard_data('Mustermann;Max', 'Max Mustermann', lng=1.234)


def test_vcard_data_valid_geo():
    expected_vcard_data = 'BEGIN:VCARD\r\n' \
                          'VERSION:3.0\r\n' \
                          'N:Mustermann;Max\r\n' \
                          'FN:Max Mustermann\r\n' \
                          'GEO:46.235197;8.015445\r\n' \
                          'END:VCARD\r\n'
    vcard = helpers.make_vcard_data('Mustermann;Max', 'Max Mustermann',
                                    lat=46.235197, lng=8.015445)
    assert expected_vcard_data == vcard


def test_vcard():
    qr = helpers.make_vcard(name='Mustermann;Max', displayname='Max Mustermann')
    assert qr


def test_email_data():

# Path: segno/helpers.py
# _MECARD_ESCAPE = {
#     ord('\\'): "\\\\",
#     ord(';'): "\\;",
#     ord(':'): "\\:",
#     ord('"'): '\\"',
# }
# _VCARD_ESCAPE = {
#     ord(','): '\\,',
#     ord(';'): '\\;',
# }
# def _escape_mecard(s):
# def _escape_vcard(s):
# def make_wifi_data(ssid, password=None, security=None, hidden=False):
# def make_wifi(ssid, password=None, security=None, hidden=False):
# def make_mecard_data(name, reading=None, email=None, phone=None, videophone=None,
#                      memo=None, nickname=None, birthday=None, url=None,
#                      pobox=None, roomno=None, houseno=None, city=None,
#                      prefecture=None, zipcode=None, country=None):
#     def make_multifield(name, val):
# def make_mecard(name, reading=None, email=None, phone=None, videophone=None,
#                 memo=None, nickname=None, birthday=None, url=None, pobox=None,
#                 roomno=None, houseno=None, city=None, prefecture=None,
#                 zipcode=None, country=None):
# def make_vcard_data(name, displayname, email=None, phone=None, fax=None,
#                     videophone=None, memo=None, nickname=None, birthday=None,
#                     url=None, pobox=None, street=None, city=None, region=None,
#                     zipcode=None, country=None, org=None, lat=None, lng=None,
#                     source=None, rev=None, title=None, photo_uri=None):
#     def make_multifield(name, val):
# def make_vcard(name, displayname, email=None, phone=None, fax=None,
#                videophone=None, memo=None, nickname=None, birthday=None,
#                url=None, pobox=None, street=None, city=None, region=None,
#                zipcode=None, country=None, org=None, lat=None, lng=None,
#                source=None, rev=None, title=None, photo_uri=None):
# def make_geo_data(lat, lng):
#     def float_to_str(f):
# def make_geo(lat, lng):
# def make_make_email_data(to, cc=None, bcc=None, subject=None, body=None):
#     def multi(val):
# def make_email(to, cc=None, bcc=None, subject=None, body=None):
# def _make_epc_qr_data(name, iban, amount, text=None, reference=None, bic=None,
#                       purpose=None, encoding=None):
# def make_epc_qr(name, iban, amount, text=None, reference=None, bic=None,
#                 purpose=None, encoding=None):


# Path: tests/test_helpers.py
import pytest
import segno
from segno import helpers
from datetime import date

def test_vcard_data_invalid_rev(rev):
    with pytest.raises(ValueError):
        helpers.make_vcard_data('Mustermann;Max', 'Max Mustermann', rev=rev)


def test_vcard_data_invalid_geo():
    with pytest.raises(ValueError):
        helpers.make_vcard_data('Mustermann;Max', 'Max Mustermann', lat=1.234)
    with pytest.raises(ValueError):
        helpers.make_vcard_data('Mustermann;Max', 'Max Mustermann', lng=1.234)


def test_vcard_data_valid_geo():
    expected_vcard_data = 'BEGIN:VCARD\r\n' \
                          'VERSION:3.0\r\n' \
                          'N:Mustermann;Max\r\n' \
                          'FN:Max Mustermann\r\n' \
                          'GEO:46.235197;8.015445\r\n' \
                          'END:VCARD\r\n'
    vcard = helpers.make_vcard_data('Mustermann;Max', 'Max Mustermann',
                                    lat=46.235197, lng=8.015445)
    assert expected_vcard_data == vcard


def test_vcard():
    qr = helpers.make_vcard(name='Mustermann;Max', displayname='Max Mustermann')
    assert qr


def test_email_data():

    data = helpers.make_make_email_data('me@example.org')