From 3aac49eb64362992ea53071213a37c6348197701 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 24 Feb 2022 14:59:10 +0000 Subject: [PATCH] Check that calendar items get created --- epicyon.py | 2 +- tests.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/epicyon.py b/epicyon.py index b4c32a61e..5b7dc15ee 100644 --- a/epicyon.py +++ b/epicyon.py @@ -1391,7 +1391,7 @@ if args.message: if args.secure_mode: signing_priv_key_pem = get_instance_actor_key(base_dir, domain) languages_understood = [args.language] - + print('Sending post to ' + args.sendto) send_post_via_server(signing_priv_key_pem, __version__, base_dir, session, args.nickname, args.password, diff --git a/tests.py b/tests.py index 966330e5d..6b95c7b0e 100644 --- a/tests.py +++ b/tests.py @@ -2946,6 +2946,13 @@ def test_client_to_server(base_dir: str): time.sleep(1) + # set bob to be following the calendar of alice + print('Bob follows the calendar of Alice') + following_cal_path = \ + bob_dir + '/accounts/bob@' + bob_domain + '/followingCalendar.txt' + with open(following_cal_path, 'w+') as fp: + fp.write('alice@' + alice_domain + '\n') + print('\n\n*******************************************************') print('EVENT: Alice sends to Bob via c2s') @@ -3035,6 +3042,17 @@ def test_client_to_server(base_dir: str): if os.path.isfile(os.path.join(bob_outbox_path, name))]) == 0 print(">>> s2s post arrived in Bob's inbox") + + calendar_path = bob_dir + '/accounts/bob@' + bob_domain + '/calendar' + if not os.path.isdir(calendar_path): + print('Missing calendar path: ' + calendar_path) + assert os.path.isdir(calendar_path) + assert os.path.isdir(calendar_path + '/' + str(test_date.year)) + assert os.path.isfile(calendar_path + '/' + str(test_date.year) + '/' + + str(test_date.month) + '.txt') + print(">>> calendar entry created for s2s post which arrived at " + + "Bob's inbox") + print("c2s send success\n\n\n") print('\n\nEVENT: Getting message id for the post')