119 Commits

Author SHA1 Message Date
dvklopfenstein
b75d77bf24 Test appending a multi-word line into a bib note.
https://github.com/pubs/pubs/pull/201#discussion_r305274762
2019-07-28 15:11:13 -04:00
emnllm
94112c02fe fixes inconsistant chronological listing test
* Chronological order listing output for a same year, without entry
 timestamp (added metadata field), may vary
2019-06-27 06:10:30 +00:00
emnllm
2e4af1d38f removes the month field from the chronological listing 2019-06-25 19:00:37 +00:00
emnllm
b3e9db62e1 improves chronological listing (year, month), adds test 2019-06-25 18:22:58 +00:00
ksunden
994b4da69c Check full output, not just year 2019-05-09 17:58:27 -05:00
ksunden
7ba016e54c TST: Test contents of import, not that the command fails 2019-05-09 17:37:42 -05:00
Olivier Mangin
3b6751ea1b
Minor: Removes duplicate mock import in test_usecase 2019-03-19 22:14:07 -07:00
Shane Stone
7645b0949c Add test for pubs list using citekey filter in test_usecase.py 2019-03-17 16:11:32 -07:00
Olivier Mangin
3a4acb9fa9
Partial fix for #188 2019-01-17 22:40:18 -08:00
Olivier Mangin
c8352fb7df
Fixes test not passing because bitexparser's latex_to_unicode also normalizes 2019-01-14 23:00:41 -08:00
Fabien C. Y. Benureau
9bf88649a3
fix #172 2019-01-05 01:06:44 +09:00
Fabien C. Y. Benureau
6865e29d15
fix for Python 2 2019-01-05 00:45:25 +09:00
Fabien C. Y. Benureau
b99c5b43fa
handle / in citekeys 2019-01-04 23:17:54 +09:00
Olivier Mangin
da70d3c381
Handles listing papers with documents without extension. 2018-09-26 22:44:48 -07:00
Fabien C. Y. Benureau
49e6c7d9c2
update tests 2018-08-28 17:37:35 +09:00
Fabien C. Y. Benureau
a58f1b1d5e
hotfix for #164 2018-08-27 11:52:52 +09:00
Olivier Mangin
42d75d1230
Merge branch 'master' into fix/doc_add 2018-08-20 13:25:40 +02:00
Olivier Mangin
c2e52ec4c4
Makes 'copy' the default for the add_doc configuration option. 2018-08-20 12:18:23 +02:00
Olivier Mangin
7dae35e722
Adds the statistics command. (Fixes #8) 2018-08-09 23:48:29 +02:00
Olivier Mangin
a8de97c327
Fixes #144: behavior of add_copy mode during add.
- correctly handles add_copy mode and configuration,
- add option top force 'copy' mode (since the default had been changed
in between from 'copy' to 'move' this is now needed),
- fixes assumption in one test that the default is 'copy' (in other
words the test was broken and ensuring that the functionality was broken
too.),
- do not try to delete the source when it is an URL.
2018-08-09 19:00:01 +02:00
Olivier Mangin
ea2bc7f732
Merge branch 'master' into fix87 2018-08-01 15:02:01 +02:00
Olivier Mangin
3d76501a5c
Merge branch 'master' into fix/pyfakefs37 2018-08-01 14:36:24 +02:00
Fabien C. Y. Benureau
c76c7607f9
Upgrade pyfakefs to current version
Fix #148. Also did some cleanup on the tests.
2018-08-01 14:22:18 +09:00
Olivier Mangin
5a47150aad
Adds option to ignore malformed bibtex files or entry during import. 2018-07-30 18:24:56 +02:00
Olivier Mangin
60650b874a
Addresses minor comments (error message and better test). 2018-07-30 17:46:04 +02: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
d8dc386a18
Fix fake input behavior in tests on unexpected input.
Because of the mechanism for catching exceptions in pubs, the
UnexpectedInput exception raised by FakeInput never reached the catch
statement in the CommandTestCase and raised a FakeSystemExit instead.

This commit monkey-patches the exception handler in the ui at the same
time as the patching of the input functions to ignore UnexptectedInput
at the ui level.
2018-07-25 19:59:23 +02:00
Olivier Mangin
fbd29d27a4
Merge pull request #141 from pubs/feat/editor_missing
error message when editor is missing
2018-07-25 17:23:06 +02:00
Olivier Mangin
8fe650c040
Use join for joining paths. 2018-07-25 12:44:15 +02:00
ksunden
a0525b5147 Remove unused /dev/null 2018-05-22 20:56:34 -05:00
ksunden
2f59b4f2ce Clean up tests 2018-05-22 20:16:50 -05:00
ksunden
aaf2ed52c1 Use mock to test url command 2018-05-22 10:32:43 -05:00
Fabien C. Y. Benureau
6cd74a9966
error message when editor is missing
simplified a bit the ui code, to remove unecessary out-of-class functions
(needed anyway because of ui.error calls).
2018-05-17 09:22:31 +09:00
Fabien C. Y. Benureau
913a5d77b5 unicode citekey in python2; removes 2018-04-10 14:55:55 +09:00
Fabien C. Y. Benureau
c7e9470300 implement requested changes for #133 2018-04-10 14:46:27 +09: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
Fabien C. Y. Benureau
38133fc053 fix for utf8 citekeys 2018-04-10 14:44:01 +09:00
Olivier Mangin
bcf216183f
Fixes tests for printing help on --help and without argument.
(fix #135)
2018-03-27 15:44:20 -04:00
Olivier Mangin
6e39cea473 Adds --strict option to list to force strict unicode comparison. 2018-02-20 18:06:33 -05:00
Fabien C. Y. Benureau
8126a0e0b4 Fix bibtex testcase, closes #25.
Also, made pyfakefs a straight pypi requirement, rather than a
github one, as no dev feature is needed since the last release.
2018-02-16 17:53:56 +09:00
Olivier Mangin
328f2a6d5e Adds more checks and better error message against empty citekeys. 2018-01-25 22:37:11 -05:00
Olivier Mangin
860181e278 Adds argument to ignore fields in export. [Closes #67]
`pubs export --ignore-fields abstract,note CiteKey`
2018-01-07 13:40:06 -05:00
Olivier Mangin
3e31c4455e Fixes argument and adds tests for overwrite on import. 2017-12-11 15:49:06 -05:00
Bill Flynn
0c7ba85af9 Revisions subject to comments on PR #100
Additionally, reverted FakeSystemExit subclassing Exception, but added
an explicit __init__ so that we can emulate the SystemExit.code
functionality without having to change the superclass.
2017-12-08 17:49:19 -05:00
Bill Flynn
66c90c5d43 Added unittest to cover new behavior pubs
Unittest just checks that both `pubs` and `pubs --help` raise a
`SystemExit` exception with error code 0.  Due to how argparse
handles the `--help` keyword, this is the best way I could think to
provide test coverage without heavily modifying the parser structure
or the unittest infrastructure.

To ensure the `pubs` matches the behavior of `pubs --help`, it now
raises the same `SystemExit(0)` exception via `sys.exit(0)`.  And
in order to catch it in the unittest, I had to modify the
`FakeSystemExit` behavior slightly.
2017-11-30 14:48:50 -05:00
Bill Flynn
ac3a8d8bf2 Print help menu when no subcommands applied
Made subparsers not required in the main parser, but if no commands are parsed,
then the parser prints its help.  When a command is present, the normal
functionality preserved.

Removed the single unittest that checks for this exact behavior.
2017-11-28 17:32:13 -05:00
Olivier Mangin
a65873a7e0 Fixes abspath called on urls preventing to get content from url.
Fix #7
2017-10-19 15:40:58 -04:00
Olivier Mangin
47f5c918ea Fix #93: saves the modifications on edit -m. 2017-10-17 16:50:23 -04:00
Olivier Mangin
69d7587108 Adds test for configuration file content in usecase. 2017-08-01 23:43:06 -04:00
Fabien C. Y. Benureau
0942df3b50 Fix pubs conf command 2017-08-01 23:43:06 -04:00