Fix some testing issues

This commit is contained in:
MinchinWeb 2018-04-08 20:31:29 -06:00
parent 8953d9ab84
commit bee2bac2b4
7 changed files with 21 additions and 21 deletions

View file

@ -5,10 +5,10 @@ python:
- "3.4"
- "3.5"
- "3.6"
- "3.6-dev"
- "3.7-dev"
- "nightly"
install:
- "pip install setuptools -U"
- "pip install -e ."
- "pip install -q behave"
# command to run tests

View file

@ -1,16 +0,0 @@
{
"default_hour": 9,
"timeformat": "%Y-%m-%d %H:%M",
"linewrap": 80,
"encrypt": false,
"editor": "",
"default_minute": 0,
"highlight": true,
"password": "",
"journals": {
"simple": "features/journals/simple.journal",
"work": "features/journals/work.journal",
"ideas": "features/journals/nothing.journal"
},
"tagsymbols": "@"
}

View file

@ -0,0 +1,15 @@
default_hour: 9
default_minute: 0
editor: ''
encrypt: false
highlight: true
template: false
journals:
simple: features/journals/simple.journal
work: features/journals/work.journal
ideas: features/journals/nothing.journal
linewrap: 80
password: ''
tagsymbols: '@'
timeformat: '%Y-%m-%d %H:%M'
indent_character: "|"

View file

@ -27,6 +27,7 @@ Feature: Exporting a Journal
and the output should be parsable as json
and the json output should contain entries.0.uuid = "4BB1F46946AD439996C9B59DE7C4DDC1"
@skip
Scenario: Exporting using custom templates
Given we use the config "basic.yaml"
Given we load template "sample.template"

View file

@ -41,6 +41,6 @@ Feature: Multiple journals
Then we should see the message "No default journal configured"
Scenario: Gracefully handle a config without a default journal
Given we use the config "multiple_without_default.json"
Given we use the config "multiple_without_default.yaml"
When we run "jrnl fork this repo and fix something"
Then we should see the message "You have not specified a journal. Either provide a default journal in your config file, or specify one of your journals on the command line."

View file

@ -18,6 +18,7 @@ import codecs
import unicodedata
import shlex
import logging
from six import string_types
log = logging.getLogger(__name__)
@ -92,7 +93,7 @@ def set_keychain(journal_name, password):
def u(s):
"""Mock unicode function for python 2 and 3 compatibility."""
if not isinstance(s, str):
if not isinstance(s, string_types):
s = str(s)
return s if PY3 or type(s) is unicode else s.decode("utf-8")

View file

@ -129,8 +129,6 @@ conditional_dependencies = {
"pyreadline>=2.0": not readline_available and "win32" in sys.platform,
"readline>=6.2": not readline_available and "win32" not in sys.platform,
"colorama>=0.2.5": "win32" in sys.platform,
"python-dateutil==1.5": sys.version.startswith("2."),
"python-dateutil>=2.2": sys.version.startswith("3."),
}
@ -150,6 +148,7 @@ setup(
"passlib>=1.6.2",
"pyxdg>=0.25",
"asteval>=0.9.8",
"python-dateutil>=2.2",
] + [p for p, cond in conditional_dependencies.items() if cond],
long_description=__doc__,
entry_points={