23 Commits

Author SHA1 Message Date
Robert Schütz
cb61ff6fc8 preserve case of field 'type'
Non-standard types such as "Diplomarbeit" should not be converted to
lowercase.
2021-02-27 12:59:56 +01:00
Olivier Mangin
7c5cbf4267
Minor: remove unused partial test. 2021-01-19 12:56:57 -08:00
Olivier Mangin
c363e13cbf
Fix collision of entry type key with valid field name 'type'.
Fixes #252.
2021-01-17 14:38:04 -08:00
Olivier Mangin
c3cb713ae7
Fix test broken likely by pyyaml update by making it more explicit
- does not test a specific output from pyyaml dump anymore,
- explicitely check decode and encode-decode step.
2019-02-28 22:51:27 -08:00
Fabien C. Y. Benureau
be80e75cbb
better error message when parsing of bibtex fails
Plus, slight refactoring: remove `databroker.verify()` method
2018-08-06 17:45:30 +09:00
Olivier Mangin
8a7d143261
Improves behaviors related to bibtex decoding error.
- from editor input in add and edit commands,
- from files in import command.
2018-07-25 22:20:14 +02:00
Olivier Mangin
2f48f37199
Fixes duplicated test names in same TestCase (1st was not run). 2018-07-25 18:30:26 +02:00
Fabien C. Y. Benureau
dc4e118c3c make utf8 citekeys possible in python 2.7. closes #28
This involved many changes, some side effects of the change include:
- remove of all `u"abc"` forms, in favor of
  `from __future__ import unicode_literals`. Their usage was
  inconsistent anyway, leading to problems when mixing with
  unicode content.
- improve the tests, to allow printing for usecase even when
  crashing. Should make future test easier. This is done with a
  rather hacky `StdIO` class in `p3`, but it works.
- for some reason, the skipped test for Python 2 seems to work
  now. While the previous point might seem related, it is not clear
  that this is actually the case.
2018-04-10 14:45:54 +09:00
Olivier Mangin
71c2f40657
Merge branch 'master' into fix/link_customization 2018-03-02 13:33:14 -05:00
Olivier Mangin
a6d5df4059 Removes link and DOI customization. Fixes #119. 2018-02-21 16:14:38 -05:00
Fabien C. Y. Benureau
82aad31e5d test for common_string parsing 2018-02-21 13:59:26 +09:00
Olivier Mangin
078b2084ff Updates field orders to use 'url' and fixes broken test.
The field ordering test was broken on the latest bibtexparser since it
now replaces by default 'link' fields by 'url'.
2018-02-19 15:32:45 -05:00
Olivier Mangin
07be993d02 Moves to using bibtexparser's writer for bibdata. [Fixes #33] 2018-01-07 12:59:55 -05:00
Olivier Mangin
de2a50eeb2 Fix tests and terminology.
First this brings a change to the paper API: the terminology of bibdata
and bibentry is clarified: now bibentry is a dictionary of the form
{citekey: bibdata} where bibdata corresponds to the actual dictionary of
bibliographic fields and values {author: ..., year: ...}.
Now bibentry is an attribute of the paper object that is generated from
citekey and bibdata.

This commit fixes all tests in particular an issue with citekey in
bibentry not updated.

Also removes prints in tests and deprecated assertEquals.

Usecase tests now fail if the command ask for unexpected inputs.

Removes queries for user input in attach and add commands (for deletion
of a copied document file). The input was not coherent with tests and is
annoying.
2015-05-07 13:17:44 +02:00
Olivier Mangin
136b8f83dc Fix fake_env, fix configparser issues, uniform 'open'.
- Update fake_env for compatibility with io.
- Uniform open (through _my_open in content).
- Fix read issue for config (although still using SafeConfigParser that
  is deprecated in py3).
2014-09-11 18:35:07 +02:00
Olivier Mangin
506bb24e50 Many cleanup in unicode encoding.
Originally intended to fix a bug in edit openning fils with non-ascii
characters.

Now all data is assumed to be manipulated as unicode. Therefore all
values returned by functions from content are unicode. There are a few
exception in order to download non-unicode data without failing to
decode. These exception are marked by the 'byte_' prefix.
The io package is used instead of builtin open for all file
transactions.

The fake_env test helper has to be modified (hacked, to be honnest) since
fake_filesystem does not offer a mock of io.

This is still WIP. Two issues still have to be solved:
- first there is an UnicodeWarning raised by bibparser,
- also config is still directly using builtin open.
2014-04-23 21:28:20 +02:00
Olivier Mangin
bf2cce1c13 Only use print_function. 2014-04-19 18:09:46 +02:00
Olivier Mangin
7713e5d80e Fix encoding of keywords.
Also introduces ustr instead of unicode for python2 and str for python3.
2014-04-18 20:43:26 +02:00
Olivier Mangin
9b6f6db297 Fixes editor formatting. 2014-04-18 17:51:20 +02:00
Fabien Benureau
d3736e257b moving from pybtex to bibtextparser, fixed major regressions.
* only bibtex format is supported
* all tests except test_repo.py and edit test pass
* edit and update commands were not updated
* removed --format argument from export, only bibtex is supported.
2014-04-13 15:10:40 +02:00
Fabien Benureau
8d91545472 papers renamed 'pubs' 2013-11-14 04:40:29 +01:00
Fabien Benureau
856cfa2a4f moved test string fixtures to str_fixtures.py 2013-11-08 01:18:04 +01:00
Fabien Benureau
e26c606163 endecoder implementation 2013-11-07 22:48:40 +01:00