# Path: pubs/bibstruct.py
# TYPE_KEY = 'ENTRYTYPE'
# CONTROL_CHARS = ''.join(map(uchr, list(range(0, 32)) + list(range(127, 160))))
# CITEKEY_FORBIDDEN_CHARS = '@\'\\,#}{~%/ '  # '/' is OK for bibtex but forbidden
# CITEKEY_EXCLUDE_RE = re.compile(
#     '[%s]' % re.escape(CONTROL_CHARS + CITEKEY_FORBIDDEN_CHARS))
# def str2citekey(s):
# def check_citekey(citekey):
# def verify_bibdata(bibdata):
# def get_entry(bibdata):
# def extract_citekey(bibdata):
# def author_last(author_str):
# def valid_citekey(citekey):
# def generate_citekey(bibdata):
# def extract_docfile(bibdata, remove=False):


import unittest
import copy
import dotdot
import fixtures
from pubs import bibstruct
# -*- coding: utf-8 -*-
from __future__ import unicode_literals





class TestGenerateCitekey(unittest.TestCase):

    def test_fails_on_empty_paper(self):
        with self.assertRaises(ValueError):
            bibstruct.generate_citekey(None)

    def test_escapes_chars(self):
        doe_bibentry = copy.deepcopy(fixtures.doe_bibentry)

# Path: pubs/bibstruct.py
# TYPE_KEY = 'ENTRYTYPE'
# CONTROL_CHARS = ''.join(map(uchr, list(range(0, 32)) + list(range(127, 160))))
# CITEKEY_FORBIDDEN_CHARS = '@\'\\,#}{~%/ '  # '/' is OK for bibtex but forbidden
# CITEKEY_EXCLUDE_RE = re.compile(
#     '[%s]' % re.escape(CONTROL_CHARS + CITEKEY_FORBIDDEN_CHARS))
# def str2citekey(s):
# def check_citekey(citekey):
# def verify_bibdata(bibdata):
# def get_entry(bibdata):
# def extract_citekey(bibdata):
# def author_last(author_str):
# def valid_citekey(citekey):
# def generate_citekey(bibdata):
# def extract_docfile(bibdata, remove=False):


# Path: tests/test_bibstruct.py
import unittest
import copy
import dotdot
import fixtures
from pubs import bibstruct

# -*- coding: utf-8 -*-
from __future__ import unicode_literals





class TestGenerateCitekey(unittest.TestCase):

    def test_fails_on_empty_paper(self):
        with self.assertRaises(ValueError):
            bibstruct.generate_citekey(None)

    def test_escapes_chars(self):
        doe_bibentry = copy.deepcopy(fixtures.doe_bibentry)

        citekey, bibdata = bibstruct.get_entry(doe_bibentry)