# HG changeset patch # User Paul Boddie # Date 1455027470 -3600 # Node ID d1f1743730eaf6d7dcc66bcb9111307b803a696c # Parent 861e86e687afb591ed2dbe1ea4d37572be155cef Fixed the test configuration and tools to use an indicated journal directory. diff -r 861e86e687af -r d1f1743730ea tests/common.sh --- a/tests/common.sh Tue Feb 09 15:01:40 2016 +0100 +++ b/tests/common.sh Tue Feb 09 15:17:50 2016 +0100 @@ -11,13 +11,13 @@ ARGS="-S $STORE -P $STATIC -p $PREFS -j $JOURNAL -d" ACCEPT_SCRIPT="$THIS_DIR/test_handle.py" -ACCEPT_ARGS="accept $STORE $PREFS" +ACCEPT_ARGS="accept $STORE $JOURNAL $PREFS" COUNTER_SCRIPT="$THIS_DIR/test_handle.py" -COUNTER_ARGS="counter $STORE $PREFS" +COUNTER_ARGS="counter $STORE $JOURNAL $PREFS" DECLINE_SCRIPT="$THIS_DIR/test_handle.py" -DECLINE_ARGS="decline $STORE $PREFS" +DECLINE_ARGS="decline $STORE $JOURNAL $PREFS" FREEBUSY_SCRIPT="$BASE_DIR/tools/make_freebusy.py" FREEBUSY_ARGS="-s -n" diff -r 861e86e687af -r d1f1743730ea tests/test_handle.py --- a/tests/test_handle.py Tue Feb 09 15:01:40 2016 +0100 +++ b/tests/test_handle.py Tue Feb 09 15:17:50 2016 +0100 @@ -3,7 +3,7 @@ """ A handler to help with testing. -Copyright (C) 2014, 2015 Paul Boddie +Copyright (C) 2014, 2015, 2016 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -94,13 +94,13 @@ if __name__ == "__main__": try: - action, store_dir, preferences_dir, user = sys.argv[1:5] + action, store_dir, journal_dir, preferences_dir, user = sys.argv[1:6] if action == "counter": - start, end = sys.argv[5:7] - i = 7 + start, end = sys.argv[6:8] + i = 8 else: start, end = None, None - i = 5 + i = 6 uid, recurrenceid = (sys.argv[i:i+2] + [None] * 2)[:2] except ValueError: print >>sys.stderr, """\ @@ -121,6 +121,7 @@ sys.exit(1) store = imip_store.FileStore(store_dir) + journal = imip_store.FileJournal(journal_dir) if uid is not None: fragment = store.get_event(user, uid, recurrenceid) @@ -132,7 +133,7 @@ fragment = parse_object(sys.stdin, "utf-8") obj = Object(fragment) - handler = TestClient(obj, user, Messenger(), store, None, preferences_dir) + handler = TestClient(obj, user, Messenger(), store, None, journal, preferences_dir) response = handler.handle_request(action, start, end) if response: diff -r 861e86e687af -r d1f1743730ea tools/make_freebusy.py --- a/tools/make_freebusy.py Tue Feb 09 15:01:40 2016 +0100 +++ b/tools/make_freebusy.py Tue Feb 09 15:17:50 2016 +0100 @@ -5,7 +5,7 @@ availability schedule or the schedule of another user (using details provided when scheduling events with that user). -Copyright (C) 2014, 2015 Paul Boddie +Copyright (C) 2014, 2015, 2016 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -38,7 +38,7 @@ from imiptools.data import get_window_end, Object from imiptools.dates import get_default_timezone, to_utc_datetime from imiptools.period import insert_period -from imip_store import FileStore, FilePublisher +from imip_store import FileStore, FilePublisher, FileJournal def make_freebusy(client, participant, store_and_publish, include_needs_action, reset_updated_list, verbose): @@ -150,6 +150,7 @@ args = [] store_dir = [] publishing_dir = [] + journal_dir = [] preferences_dir = [] ignored = [] @@ -166,6 +167,8 @@ l = store_dir elif arg == "-P": l = publishing_dir + elif arg == "-j": + l = journal_dir elif arg == "-p": l = preferences_dir else: @@ -185,9 +188,10 @@ General options: --S indicate the store directory location +-j indicate the journal directory location +-p indicate the preferences directory location -P indicate the publishing directory location --p indicate the preferences directory location +-S indicate the store directory location """ % split(sys.argv[0])[1] sys.exit(1) @@ -203,12 +207,14 @@ store_dir = store_dir and store_dir[0] or None publishing_dir = publishing_dir and publishing_dir[0] or None + journal_dir = journal_dir and journal_dir[0] or None preferences_dir = preferences_dir and preferences_dir[0] or None # Obtain store-related objects. store = FileStore(store_dir) publisher = FilePublisher(publishing_dir) + journal = FileJournal(journal_dir) # Obtain a list of users for processing. @@ -223,7 +229,7 @@ if verbose: print >>sys.stderr, user make_freebusy( - Client(user, None, store, publisher, preferences_dir), participant, + Client(user, None, store, publisher, journal, preferences_dir), participant, store_and_publish, include_needs_action, reset_updated_list, verbose) # vim: tabstop=4 expandtab shiftwidth=4