From 0fa981357eb6ec43e7c59087cc173a29c97c0ba0 Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Sat, 17 Aug 2013 11:59:51 -0700 Subject: [PATCH] Initial support for DayOne integration testing --- features/data/configs/dayone.json | 14 ++++++ .../044F3747A38546168B572C2E3F217FA2.doentry | 34 ++++++++++++++ .../0BDDD6CDA43C4A9AA2681517CC35AD9D.doentry | 46 +++++++++++++++++++ .../422BC895507944A291E6FC44FC6B8BFC.doentry | 31 +++++++++++++ .../4BB1F46946AD439996C9B59DE7C4DDC1.doentry | 29 ++++++++++++ features/dayone.feature | 17 +++++++ features/environment.py | 6 ++- 7 files changed, 176 insertions(+), 1 deletion(-) create mode 100644 features/data/configs/dayone.json create mode 100644 features/data/journals/dayone.dayone/entries/044F3747A38546168B572C2E3F217FA2.doentry create mode 100644 features/data/journals/dayone.dayone/entries/0BDDD6CDA43C4A9AA2681517CC35AD9D.doentry create mode 100644 features/data/journals/dayone.dayone/entries/422BC895507944A291E6FC44FC6B8BFC.doentry create mode 100644 features/data/journals/dayone.dayone/entries/4BB1F46946AD439996C9B59DE7C4DDC1.doentry create mode 100644 features/dayone.feature diff --git a/features/data/configs/dayone.json b/features/data/configs/dayone.json new file mode 100644 index 00000000..2baf0080 --- /dev/null +++ b/features/data/configs/dayone.json @@ -0,0 +1,14 @@ +{ + "default_hour": 9, + "timeformat": "%Y-%m-%d %H:%M", + "linewrap": 80, + "encrypt": false, + "editor": "", + "default_minute": 0, + "highlight": true, + "password": "", + "journals": { + "default": "features/journals/dayone.dayone" + }, + "tagsymbols": "@" +} diff --git a/features/data/journals/dayone.dayone/entries/044F3747A38546168B572C2E3F217FA2.doentry b/features/data/journals/dayone.dayone/entries/044F3747A38546168B572C2E3F217FA2.doentry new file mode 100644 index 00000000..2bb8e3c3 --- /dev/null +++ b/features/data/journals/dayone.dayone/entries/044F3747A38546168B572C2E3F217FA2.doentry @@ -0,0 +1,34 @@ + + + + + Creation Date + 2013-05-17T18:39:20Z + Creator + + Device Agent + Macintosh/MacBookAir5,2 + Generation Date + 2013-08-17T18:39:20Z + Host Name + Egeria + OS Agent + Mac OS X/10.8.4 + Software Agent + Day One (Mac)/1.8 + + Entry Text + This entry has tags! + Starred + + Tags + + work + play + + Time Zone + America/Los_Angeles + UUID + 044F3747A38546168B572C2E3F217FA2 + + diff --git a/features/data/journals/dayone.dayone/entries/0BDDD6CDA43C4A9AA2681517CC35AD9D.doentry b/features/data/journals/dayone.dayone/entries/0BDDD6CDA43C4A9AA2681517CC35AD9D.doentry new file mode 100644 index 00000000..927de884 --- /dev/null +++ b/features/data/journals/dayone.dayone/entries/0BDDD6CDA43C4A9AA2681517CC35AD9D.doentry @@ -0,0 +1,46 @@ + + + + + Creation Date + 2013-06-17T18:38:29Z + Creator + + Device Agent + Macintosh/MacBookAir5,2 + Generation Date + 2013-08-17T18:38:29Z + Host Name + Egeria + OS Agent + Mac OS X/10.8.4 + Software Agent + Day One (Mac)/1.8 + + Entry Text + This entry has a location. + Location + + Administrative Area + California + Country + Germany + Latitude + 52.4979764 + Locality + Berlin + Longitude + 13.2404758 + Place Name + Abandoned Spy Tower + + Starred + + Tags + + Time Zone + Europe/Berlin + UUID + 0BDDD6CDA43C4A9AA2681517CC35AD9D + + diff --git a/features/data/journals/dayone.dayone/entries/422BC895507944A291E6FC44FC6B8BFC.doentry b/features/data/journals/dayone.dayone/entries/422BC895507944A291E6FC44FC6B8BFC.doentry new file mode 100644 index 00000000..16260763 --- /dev/null +++ b/features/data/journals/dayone.dayone/entries/422BC895507944A291E6FC44FC6B8BFC.doentry @@ -0,0 +1,31 @@ + + + + + Creation Date + 2013-07-17T18:38:08Z + Creator + + Device Agent + Macintosh/MacBookAir5,2 + Generation Date + 2013-08-17T18:38:08Z + Host Name + Egeria + OS Agent + Mac OS X/10.8.4 + Software Agent + Day One (Mac)/1.8 + + Entry Text + This entry is starred! + Starred + + Tags + + Time Zone + America/Los_Angeles + UUID + 422BC895507944A291E6FC44FC6B8BFC + + diff --git a/features/data/journals/dayone.dayone/entries/4BB1F46946AD439996C9B59DE7C4DDC1.doentry b/features/data/journals/dayone.dayone/entries/4BB1F46946AD439996C9B59DE7C4DDC1.doentry new file mode 100644 index 00000000..977026d7 --- /dev/null +++ b/features/data/journals/dayone.dayone/entries/4BB1F46946AD439996C9B59DE7C4DDC1.doentry @@ -0,0 +1,29 @@ + + + + + Creation Date + 2013-08-17T18:37:50Z + Creator + + Device Agent + Macintosh/MacBookAir5,2 + Generation Date + 2013-08-17T18:37:50Z + Host Name + Egeria + OS Agent + Mac OS X/10.8.4 + Software Agent + Day One (Mac)/1.8 + + Entry Text + This is a DayOne entry. + Starred + + Tags + + UUID + 4BB1F46946AD439996C9B59DE7C4DDC1 + + diff --git a/features/dayone.feature b/features/dayone.feature new file mode 100644 index 00000000..898699e1 --- /dev/null +++ b/features/dayone.feature @@ -0,0 +1,17 @@ +Feature: DayOne Ingetration + + Scenario: Loading a DayOne Journal + Given we use the config "dayone.json" + When we run "jrnl -until now" + Then we should get no error + and the output should be + """ + 2013-05-17 11:39 This entry has tags! + + 2013-06-17 20:38 This entry has a location. + + 2013-07-17 11:38 This entry is starred! + + 2013-08-17 11:37 This is a DayOne entry. + """ + diff --git a/features/environment.py b/features/environment.py index 89125fca..c5b96721 100644 --- a/features/environment.py +++ b/features/environment.py @@ -18,7 +18,11 @@ def before_scenario(context, scenario): if not os.path.exists(working_dir): os.mkdir(working_dir) for filename in os.listdir(original): - shutil.copy2(os.path.join(original, filename), working_dir) + source = os.path.join(original, filename) + if os.path.isdir(source): + shutil.copytree(source, os.path.join(working_dir, filename)) + else: + shutil.copy2(source, working_dir) def after_scenario(context, scenario): """After each scenario, restore all test data and remove working_dirs."""