diff --git a/data/setUp.json b/data/setUp.json new file mode 100644 index 0000000..f8ec29e --- /dev/null +++ b/data/setUp.json @@ -0,0 +1 @@ +{"{\"body\": \"{\\\"passphrase\\\": \\\"correct horse battery staple profanity oil chewy\\\", \\\"username\\\": \\\"journalist\\\"}\", \"method\": \"POST\", \"path_query\": \"api/v1/token\"}+1": "{\"body\": \"{\\n \\\"expiration\\\": \\\"2018-10-15T18:50:30.596706Z\\\", \\n \\\"token\\\": \\\"eyJhbGciOiJIUzI1NiIsImV4cCI6MTUzOTYyOTQzMCwiaWF0IjoxNTM5NjAwNjMwfQ.eyJpZCI6MX0.DxMon85hJuDUFMJdeWdICVQ7slqQHsIx2aNC2F88Ljk\\\"\\n}\\n\", \"headers\": {\"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Content-Type\": \"application/json\", \"Content-Length\": \"188\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo1MDozMCBHTVQifX0.DqYCdg.JSb0AxCyX5KKX8QeFaHOM32pJvM; HttpOnly; Path=/\", \"Vary\": \"Cookie\", \"Date\": \"Mon, 15 Oct 2018 10:50:30 GMT\"}, \"version\": \"0.1.1\", \"status\": 200}"} \ No newline at end of file diff --git a/data/test-get-wrong-submissions.yml b/data/test-get-wrong-submissions.yml index 053e774..f9f75b5 100644 --- a/data/test-get-wrong-submissions.yml +++ b/data/test-get-wrong-submissions.yml @@ -80,7 +80,7 @@ interactions: Content-Type: [application/json] User-Agent: [python-requests/2.19.1] method: GET - uri: http://localhost:8081/api/v1/sources/rofl-missing/submissions/2334 + uri: http://localhost:8081/api/v1/sources/rofl-missing/submissions response: body: {string: "{\n \"error\": \"Not Found\", \n \"message\": \"The requested\ \ URL was not found on the server. If you entered the URL manually please\ diff --git a/data/test_delete_reply.json b/data/test_delete_reply.json new file mode 100644 index 0000000..681de88 --- /dev/null +++ b/data/test_delete_reply.json @@ -0,0 +1 @@ +{"{\"body\": \"{\\\"passphrase\\\": \\\"correct horse battery staple profanity oil chewy\\\", \\\"username\\\": \\\"journalist\\\"}\", \"method\": \"POST\", \"path_query\": \"api/v1/token\"}+1": "{\"headers\": {\"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Content-Length\": \"73\", \"Vary\": \"Cookie\", \"Date\": \"Mon, 15 Oct 2018 10:39:04 GMT\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjozOTowNCBHTVQifX0.DqX_yA.EV_fWPcFtNbKcms0sYAzPKtvPyM; HttpOnly; Path=/\"}, \"version\": \"0.1.1\", \"status\": 403, \"body\": \"{\\n \\\"error\\\": \\\"Forbidden\\\", \\n \\\"message\\\": \\\"Token authentication failed.\\\"\\n}\\n\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/replies\"}+1": "{\"body\": \"{\\n \\\"replies\\\": [\\n {\\n \\\"filename\\\": \\\"3-unmanly_salmonellosis-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"eb4a8050-7eb7-496a-ae75-1ef66db677bc\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/b2d7bda5-0f50-4baf-ba3b-591cf65c6a3a/replies/e76b4ac1-01a3-497c-bc0f-8ea5bbd846f1\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/b2d7bda5-0f50-4baf-ba3b-591cf65c6a3a\\\", \\n \\\"uuid\\\": \\\"e76b4ac1-01a3-497c-bc0f-8ea5bbd846f1\\\"\\n }, \\n {\\n \\\"filename\\\": \\\"4-unmanly_salmonellosis-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"eb4a8050-7eb7-496a-ae75-1ef66db677bc\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/b2d7bda5-0f50-4baf-ba3b-591cf65c6a3a/replies/98393589-7442-45b9-83b6-3cb45f3f7b2a\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/b2d7bda5-0f50-4baf-ba3b-591cf65c6a3a\\\", \\n \\\"uuid\\\": \\\"98393589-7442-45b9-83b6-3cb45f3f7b2a\\\"\\n }, \\n {\\n \\\"filename\\\": \\\"3-bulimic_redress-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"eb4a8050-7eb7-496a-ae75-1ef66db677bc\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/103be2d8-7ab8-4188-94ef-4f98e9c398fe/replies/71327942-53dd-4d03-917c-645e1f0c7ed7\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/103be2d8-7ab8-4188-94ef-4f98e9c398fe\\\", \\n \\\"uuid\\\": \\\"71327942-53dd-4d03-917c-645e1f0c7ed7\\\"\\n }, \\n {\\n \\\"filename\\\": \\\"4-bulimic_redress-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"eb4a8050-7eb7-496a-ae75-1ef66db677bc\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/103be2d8-7ab8-4188-94ef-4f98e9c398fe/replies/e2ea71b4-7403-4592-a96f-679207f17b14\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/103be2d8-7ab8-4188-94ef-4f98e9c398fe\\\", \\n \\\"uuid\\\": \\\"e2ea71b4-7403-4592-a96f-679207f17b14\\\"\\n }\\n ]\\n}\\n\", \"status\": 200, \"version\": \"0.1.1\", \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjozOTowNSBHTVQifX0.DqX_yQ.64wh2borsgv4MfYZnoBTbYNeQxY; HttpOnly; Path=/\", \"Date\": \"Mon, 15 Oct 2018 10:39:05 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Content-Length\": \"1969\", \"Content-Type\": \"application/json\"}}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"DELETE\", \"path_query\": \"api/v1/sources/b2d7bda5-0f50-4baf-ba3b-591cf65c6a3a/replies/e76b4ac1-01a3-497c-bc0f-8ea5bbd846f1\"}+2": "{\"status\": 200, \"body\": \"{\\n \\\"message\\\": \\\"Reply deleted\\\"\\n}\\n\", \"version\": \"0.1.1\", \"headers\": {\"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Date\": \"Mon, 15 Oct 2018 10:39:06 GMT\", \"Content-Type\": \"application/json\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjozOTowNiBHTVQifX0.DqX_yg.0uR9ucOz50EqOTDgn6AuRBKKfNg; HttpOnly; Path=/\", \"Content-Length\": \"33\"}}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/replies\"}+3": "{\"body\": \"{\\n \\\"replies\\\": [\\n {\\n \\\"filename\\\": \\\"4-unmanly_salmonellosis-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"eb4a8050-7eb7-496a-ae75-1ef66db677bc\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/b2d7bda5-0f50-4baf-ba3b-591cf65c6a3a/replies/98393589-7442-45b9-83b6-3cb45f3f7b2a\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/b2d7bda5-0f50-4baf-ba3b-591cf65c6a3a\\\", \\n \\\"uuid\\\": \\\"98393589-7442-45b9-83b6-3cb45f3f7b2a\\\"\\n }, \\n {\\n \\\"filename\\\": \\\"3-bulimic_redress-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"eb4a8050-7eb7-496a-ae75-1ef66db677bc\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/103be2d8-7ab8-4188-94ef-4f98e9c398fe/replies/71327942-53dd-4d03-917c-645e1f0c7ed7\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/103be2d8-7ab8-4188-94ef-4f98e9c398fe\\\", \\n \\\"uuid\\\": \\\"71327942-53dd-4d03-917c-645e1f0c7ed7\\\"\\n }, \\n {\\n \\\"filename\\\": \\\"4-bulimic_redress-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"eb4a8050-7eb7-496a-ae75-1ef66db677bc\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/103be2d8-7ab8-4188-94ef-4f98e9c398fe/replies/e2ea71b4-7403-4592-a96f-679207f17b14\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/103be2d8-7ab8-4188-94ef-4f98e9c398fe\\\", \\n \\\"uuid\\\": \\\"e2ea71b4-7403-4592-a96f-679207f17b14\\\"\\n }\\n ]\\n}\\n\", \"headers\": {\"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjozOTowNiBHTVQifX0.DqX_yw.BR8eGjBy2Nxz7Nn-EY88EpHfiGo; HttpOnly; Path=/\", \"Date\": \"Mon, 15 Oct 2018 10:39:07 GMT\", \"Content-Type\": \"application/json\", \"Content-Length\": \"1479\"}, \"status\": 200, \"version\": \"0.1.1\"}"} \ No newline at end of file diff --git a/data/test_delete_source.json b/data/test_delete_source.json new file mode 100644 index 0000000..e181cac --- /dev/null +++ b/data/test_delete_source.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/ec973f69-7afc-43fa-b810-dd3090fd1fba/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"receptive herald\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEcNgBEACwzyiYcLvntPZ7fWONQBwD8IeuunhTXTsyAX0kPUVTD6tqP0cU\\\\nF2xcYACVOjglSL+dnLkAUI8aszEdI8oX74OYfLrzGnmACr7wQfwZ3Y7m3U95DsNU\\\\nOMMAjot5Y4OA9cvf7RWDYLTfT7Me5mMwadmfNmXXgLf3QDnUGldZCe15U3Q7K1pG\\\\nS7V+a2VS9leGl3vRrQosyjpaVmtQOBWEb3/Xij8ntXUQIFT4wBATth2nGQ5fYHoe\\\\nxoe5dQBpUZwsXNnGZ+emQM8EJE/Xxm0T7ZZngHsU9DsES5SUMmkPaAdivWTvPvEt\\\\nOSThzdO6qnvBwNHTCmlOkkm7NFxBt8kxiOjB+21wtVnz6noVqvht1Ca1p7W+2A4M\\\\nfo2QvTHwYeG09204lrJljUF9MasvVeuViuxIdtHkPnC7smr25nPMucGqKwS/R2q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i/nSdM0m1pXe/F+dO+E/cT3Q4Ky\\\\niXhCPzc/ZwXFEnMrDihs45fcNBosvr3wpyGPNIMSj62JZVp9bVTKsTumKQVe8A/Y\\\\n0KxacDSsxNXq9bcDZgGHoxJ2hYYdHN7iQXTHWYBkTqDqvRAAz1WKOsh1nN3i9/6Y\\\\nNB8vfRFCHXiVxtYMez9oMYK0bpe9J4QvbomxDc2nFMg=\\\\n=d4Np\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:50:04.759461Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/ec973f69-7afc-43fa-b810-dd3090fd1fba/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/ec973f69-7afc-43fa-b810-dd3090fd1fba/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/ec973f69-7afc-43fa-b810-dd3090fd1fba/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/ec973f69-7afc-43fa-b810-dd3090fd1fba\\\", \\n \\\"uuid\\\": \\\"ec973f69-7afc-43fa-b810-dd3090fd1fba\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"raising electroplate\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEcN8BEAC3pD6oGMqSN/YNvKxtxen4TYd7itO/dyN8qTGAeK/mSD7089ux\\\\nwf7mWrBPHcxbMOUj5mCfJIf1g9OGfb/Wl6W3Ndn+xAD7dXwFjWlW0dAs/VYZ9fvJ\\\\n2oDO8pJIS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dTFUekQPK4wTxbtv0+mOjS\\\\n6NVWOpNdekTiLjTX6vz/pHGp2c/8sKm10XP65OA9gn/HlrtpXdPOCwAc9nr1QFxW\\\\naQnO07jPW/DORrWJACHwKl+VUlPROY6l1L5xF7n+wCynwJYgvbx3+CmDizpFsMc1\\\\nWoMKcxQsgKFMPYeoDA47cOiCGySYXRsDnN/CLLho9f/VCRA6m3uo3wUW2ZdjJUdW\\\\nx6ySidtHd9I/mV7wapIZM3g5x53vHGqFjPcqRH1Ms8fhDuK4x9suz5otKBuqxvtm\\\\nbgIT7EXMjb3evZFwLwi9rEb09an00pOV7qCha21G+TCdA9/kDtfTBYIvwaTcx1WZ\\\\nO71hayr6Qijn3pdy8j9MDT21MJGaT8oRDRq/Z2rU4ZeAYRJUP0BWJYT/WyrPiba6\\\\nnUSPOg9SX62II3K22D3vy/ftgPbUbC9n6QsYC2Dcij6AoFqVZRxM/beltg02vS4U\\\\nE3sQDNAupjiBXn34pZzjec1/PyQuIhk07UejJhgg6tQ=\\\\n=t9WV\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:50:08.360591Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b\\\", \\n \\\"uuid\\\": \\\"b4071b88-a05b-452f-9c6e-2aa1191c085b\\\"\\n }\\n ]\\n}\\n\", \"headers\": {\"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo1MzowMyBHTVQifX0.DqYDDw.RitzC--vVUjS-a5gMBXQ1EHFFVA; HttpOnly; Path=/\", \"Content-Type\": \"application/json\", \"Vary\": \"Cookie\", \"Date\": \"Mon, 15 Oct 2018 10:53:03 GMT\", \"Content-Length\": \"5239\"}, \"status\": 200, \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"DELETE\", \"path_query\": \"api/v1/sources/ec973f69-7afc-43fa-b810-dd3090fd1fba\"}+2": "{\"headers\": {\"Date\": \"Mon, 15 Oct 2018 10:53:04 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo1MzowNCBHTVQifX0.DqYDEA.d60t9CZ1CIcD0bo5HHxI_l-awyQ; HttpOnly; Path=/\", \"Content-Length\": \"50\", \"Content-Type\": \"application/json\", \"Vary\": \"Cookie\"}, \"body\": \"{\\n \\\"message\\\": \\\"Source and submissions deleted\\\"\\n}\\n\", \"version\": \"0.1.1\", \"status\": 200}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+3": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"raising electroplate\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\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zalrOWQhIdHD4AK1RQGaYZeBu6/gHGnPUpD20ja4\\\\n6mdA6shp2VW6RIXFTignClpDkfgcDfYmFGAoqbTbNwy5Vf3y5lfV/ckcIp25aaQq\\\\nMQt5cySNyQs8Pfos9sHUwCIgGathOmvohdyaPjhN9/dTFUekQPK4wTxbtv0+mOjS\\\\n6NVWOpNdekTiLjTX6vz/pHGp2c/8sKm10XP65OA9gn/HlrtpXdPOCwAc9nr1QFxW\\\\naQnO07jPW/DORrWJACHwKl+VUlPROY6l1L5xF7n+wCynwJYgvbx3+CmDizpFsMc1\\\\nWoMKcxQsgKFMPYeoDA47cOiCGySYXRsDnN/CLLho9f/VCRA6m3uo3wUW2ZdjJUdW\\\\nx6ySidtHd9I/mV7wapIZM3g5x53vHGqFjPcqRH1Ms8fhDuK4x9suz5otKBuqxvtm\\\\nbgIT7EXMjb3evZFwLwi9rEb09an00pOV7qCha21G+TCdA9/kDtfTBYIvwaTcx1WZ\\\\nO71hayr6Qijn3pdy8j9MDT21MJGaT8oRDRq/Z2rU4ZeAYRJUP0BWJYT/WyrPiba6\\\\nnUSPOg9SX62II3K22D3vy/ftgPbUbC9n6QsYC2Dcij6AoFqVZRxM/beltg02vS4U\\\\nE3sQDNAupjiBXn34pZzjec1/PyQuIhk07UejJhgg6tQ=\\\\n=t9WV\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:50:08.360591Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b\\\", \\n \\\"uuid\\\": \\\"b4071b88-a05b-452f-9c6e-2aa1191c085b\\\"\\n }\\n ]\\n}\\n\", \"headers\": {\"Date\": \"Mon, 15 Oct 2018 10:53:04 GMT\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo1MzowNCBHTVQifX0.DqYDEA.d60t9CZ1CIcD0bo5HHxI_l-awyQ; HttpOnly; Path=/\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Content-Length\": \"2632\"}}"} \ No newline at end of file diff --git a/data/test_delete_source_from_string.json b/data/test_delete_source_from_string.json new file mode 100644 index 0000000..e181cac --- /dev/null +++ b/data/test_delete_source_from_string.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/ec973f69-7afc-43fa-b810-dd3090fd1fba/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"receptive herald\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEcNgBEACwzyiYcLvntPZ7fWONQBwD8IeuunhTXTsyAX0kPUVTD6tqP0cU\\\\nF2xcYACVOjglSL+dnLkAUI8aszEdI8oX74OYfLrzGnmACr7wQfwZ3Y7m3U95DsNU\\\\nOMMAjot5Y4OA9cvf7RWDYLTfT7Me5mMwadmfNmXXgLf3QDnUGldZCe15U3Q7K1pG\\\\nS7V+a2VS9leGl3vRrQosyjpaVmtQOBWEb3/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DtWH2qbBp51CHlpxmeT8IIlLhlXEoNWMNQ68Q/ZL4bGiW2b4m\\\\nViUhqzn8glzQg9AIWnT5l9ewkB+OMW/MB2yu0LJVBIbVDX1azSJaudibGi0rM6dr\\\\n08qRei8ee72MQgSHWfyhLO75d0xJK/BSh9j+qaC99hrh3wpfMWeDbiHzLyiKEqE6\\\\nR6uOMmcvQKJ+01X5iB0JBfo0lc5mQGUJE1PVPi/nSdM0m1pXe/F+dO+E/cT3Q4Ky\\\\niXhCPzc/ZwXFEnMrDihs45fcNBosvr3wpyGPNIMSj62JZVp9bVTKsTumKQVe8A/Y\\\\n0KxacDSsxNXq9bcDZgGHoxJ2hYYdHN7iQXTHWYBkTqDqvRAAz1WKOsh1nN3i9/6Y\\\\nNB8vfRFCHXiVxtYMez9oMYK0bpe9J4QvbomxDc2nFMg=\\\\n=d4Np\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:50:04.759461Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/ec973f69-7afc-43fa-b810-dd3090fd1fba/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/ec973f69-7afc-43fa-b810-dd3090fd1fba/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/ec973f69-7afc-43fa-b810-dd3090fd1fba/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/ec973f69-7afc-43fa-b810-dd3090fd1fba\\\", \\n \\\"uuid\\\": \\\"ec973f69-7afc-43fa-b810-dd3090fd1fba\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"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AcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQgxInu0B2qA+pYQ/+\\\\nJuLjhArDN0ndA+viedkDr2TxzalrOWQhIdHD4AK1RQGaYZeBu6/gHGnPUpD20ja4\\\\n6mdA6shp2VW6RIXFTignClpDkfgcDfYmFGAoqbTbNwy5Vf3y5lfV/ckcIp25aaQq\\\\nMQt5cySNyQs8Pfos9sHUwCIgGathOmvohdyaPjhN9/dTFUekQPK4wTxbtv0+mOjS\\\\n6NVWOpNdekTiLjTX6vz/pHGp2c/8sKm10XP65OA9gn/HlrtpXdPOCwAc9nr1QFxW\\\\naQnO07jPW/DORrWJACHwKl+VUlPROY6l1L5xF7n+wCynwJYgvbx3+CmDizpFsMc1\\\\nWoMKcxQsgKFMPYeoDA47cOiCGySYXRsDnN/CLLho9f/VCRA6m3uo3wUW2ZdjJUdW\\\\nx6ySidtHd9I/mV7wapIZM3g5x53vHGqFjPcqRH1Ms8fhDuK4x9suz5otKBuqxvtm\\\\nbgIT7EXMjb3evZFwLwi9rEb09an00pOV7qCha21G+TCdA9/kDtfTBYIvwaTcx1WZ\\\\nO71hayr6Qijn3pdy8j9MDT21MJGaT8oRDRq/Z2rU4ZeAYRJUP0BWJYT/WyrPiba6\\\\nnUSPOg9SX62II3K22D3vy/ftgPbUbC9n6QsYC2Dcij6AoFqVZRxM/beltg02vS4U\\\\nE3sQDNAupjiBXn34pZzjec1/PyQuIhk07UejJhgg6tQ=\\\\n=t9WV\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:50:08.360591Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b\\\", \\n \\\"uuid\\\": \\\"b4071b88-a05b-452f-9c6e-2aa1191c085b\\\"\\n }\\n ]\\n}\\n\", \"headers\": {\"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo1MzowMyBHTVQifX0.DqYDDw.RitzC--vVUjS-a5gMBXQ1EHFFVA; HttpOnly; Path=/\", \"Content-Type\": \"application/json\", \"Vary\": \"Cookie\", \"Date\": \"Mon, 15 Oct 2018 10:53:03 GMT\", \"Content-Length\": \"5239\"}, \"status\": 200, \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"DELETE\", \"path_query\": \"api/v1/sources/ec973f69-7afc-43fa-b810-dd3090fd1fba\"}+2": "{\"headers\": {\"Date\": \"Mon, 15 Oct 2018 10:53:04 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo1MzowNCBHTVQifX0.DqYDEA.d60t9CZ1CIcD0bo5HHxI_l-awyQ; HttpOnly; Path=/\", \"Content-Length\": \"50\", \"Content-Type\": \"application/json\", \"Vary\": \"Cookie\"}, \"body\": \"{\\n \\\"message\\\": \\\"Source and submissions deleted\\\"\\n}\\n\", \"version\": \"0.1.1\", \"status\": 200}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+3": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"raising electroplate\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEcN8BEAC3pD6oGMqSN/YNvKxtxen4TYd7itO/dyN8qTGAeK/mSD7089ux\\\\nwf7mWrBPHcxbMOUj5mCfJIf1g9OGfb/Wl6W3Ndn+xAD7dXwFjWlW0dAs/VYZ9fvJ\\\\n2oDO8pJISebYFLB9GiZkiFxjrZvJwfbMVWKfZ988XdDw1N8wEd4UjUKWLh+y4b+Q\\\\n3fsoqhYVSQaeuJAyqVXEW0TYpQ6zLNpqyY4PVrHl7rR4xh3pFgmA4t09sg95z+is\\\\ncc9ChucDeKbvzg8Apbjy6NXSRWQz5+fWJ5gEakL6GwThC9J93jOS9auLmgnnXzoQ\\\\nf/b5z6+zLQhMwIKT+z4EL1XaI7pBTmR4eC1dFvwMGrzUsrUbGTT4vnAygfVnc25J\\\\nhdtDVwoaE5esME246cIji485w8Kwfh7ih3HJRRSRJl1spx77ZKVZdWszdfiLXaV6\\\\nUHg/Qe6F19CiXF5TPFt8ck1P4X2viVqoA0GPNQk/EmlsLqDd7VqVPjnSoA1tNJKl\\\\nHhouqxCttwV6QBKrtFuQ3KTfDKRBs8Cs372L6vX8AS9CXYuK4Ne2kbWk+PVlr9hO\\\\nvfjXuO1OE/448/vJUvcndRbKt0P1+NscWRj6rMS8DC27Rrd32QY3bupy5r5ztUeY\\\\naVH3jFM5MwH8+9M2ExrOqhtWnhxiyn/ouUNFZX0jWWBhhELOubj4KoI0awARAQAB\\\\ntHxBdXRvZ2VuZXJhdGVkIEtleSA8UlpJNkY2TktOMlNDSUpNQ0FTN1hXVzJGM1ZM\\\\nR1ZPQVdHSVpYWUNOSzRBVk9WQ1RGRDdJQjdMRjY3SjNNRUk1S1lDRkNXNFk2U0JB\\\\nNjRRVVhRTFZOMjVGVjJXQ0hBS05YNUhWQzdZST0+iQI/BBMBCgApBQJbxHDfAhsv\\\\nBQkB4UPhBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQgxInu0B2qA+pYQ/+\\\\nJuLjhArDN0ndA+viedkDr2TxzalrOWQhIdHD4AK1RQGaYZeBu6/gHGnPUpD20ja4\\\\n6mdA6shp2VW6RIXFTignClpDkfgcDfYmFGAoqbTbNwy5Vf3y5lfV/ckcIp25aaQq\\\\nMQt5cySNyQs8Pfos9sHUwCIgGathOmvohdyaPjhN9/dTFUekQPK4wTxbtv0+mOjS\\\\n6NVWOpNdekTiLjTX6vz/pHGp2c/8sKm10XP65OA9gn/HlrtpXdPOCwAc9nr1QFxW\\\\naQnO07jPW/DORrWJACHwKl+VUlPROY6l1L5xF7n+wCynwJYgvbx3+CmDizpFsMc1\\\\nWoMKcxQsgKFMPYeoDA47cOiCGySYXRsDnN/CLLho9f/VCRA6m3uo3wUW2ZdjJUdW\\\\nx6ySidtHd9I/mV7wapIZM3g5x53vHGqFjPcqRH1Ms8fhDuK4x9suz5otKBuqxvtm\\\\nbgIT7EXMjb3evZFwLwi9rEb09an00pOV7qCha21G+TCdA9/kDtfTBYIvwaTcx1WZ\\\\nO71hayr6Qijn3pdy8j9MDT21MJGaT8oRDRq/Z2rU4ZeAYRJUP0BWJYT/WyrPiba6\\\\nnUSPOg9SX62II3K22D3vy/ftgPbUbC9n6QsYC2Dcij6AoFqVZRxM/beltg02vS4U\\\\nE3sQDNAupjiBXn34pZzjec1/PyQuIhk07UejJhgg6tQ=\\\\n=t9WV\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:50:08.360591Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/b4071b88-a05b-452f-9c6e-2aa1191c085b\\\", \\n \\\"uuid\\\": \\\"b4071b88-a05b-452f-9c6e-2aa1191c085b\\\"\\n }\\n ]\\n}\\n\", \"headers\": {\"Date\": \"Mon, 15 Oct 2018 10:53:04 GMT\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo1MzowNCBHTVQifX0.DqYDEA.d60t9CZ1CIcD0bo5HHxI_l-awyQ; HttpOnly; Path=/\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Content-Length\": \"2632\"}}"} \ No newline at end of file diff --git a/data/test_delete_submission.json b/data/test_delete_submission.json new file mode 100644 index 0000000..c30f0f7 --- /dev/null +++ b/data/test_delete_submission.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/submissions\"}+1": "{\"status\": 200, \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo1NToyNSBHTVQifX0.DqYDnQ.rrygdqGK86afft7ACBBMPuW7id8; HttpOnly; Path=/\", \"Content-Length\": \"2049\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Content-Type\": \"application/json\", \"Date\": \"Mon, 15 Oct 2018 10:55:25 GMT\", \"Vary\": \"Cookie\"}, \"body\": \"{\\n \\\"submissions\\\": [\\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/c3ddd7a5-6763-4ab8-978f-4329f9db2e55/submissions/bccb8dee-5a2f-4e6e-b640-a66fc47bff17/download\\\", \\n \\\"filename\\\": \\\"1-palatable_flue-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/c3ddd7a5-6763-4ab8-978f-4329f9db2e55\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/c3ddd7a5-6763-4ab8-978f-4329f9db2e55/submissions/bccb8dee-5a2f-4e6e-b640-a66fc47bff17\\\", \\n \\\"uuid\\\": \\\"bccb8dee-5a2f-4e6e-b640-a66fc47bff17\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/c3ddd7a5-6763-4ab8-978f-4329f9db2e55/submissions/4ef58591-2dda-4f6a-ac3a-415347d5ab46/download\\\", \\n \\\"filename\\\": \\\"2-palatable_flue-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/c3ddd7a5-6763-4ab8-978f-4329f9db2e55\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/c3ddd7a5-6763-4ab8-978f-4329f9db2e55/submissions/4ef58591-2dda-4f6a-ac3a-415347d5ab46\\\", \\n \\\"uuid\\\": \\\"4ef58591-2dda-4f6a-ac3a-415347d5ab46\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/0f9faa3a-4fd7-4798-9a70-ebd5760d5670/submissions/e6bac35e-4042-4a13-89d7-4412ec3150c1/download\\\", \\n \\\"filename\\\": \\\"1-penny-wise_telepathy-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/0f9faa3a-4fd7-4798-9a70-ebd5760d5670\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/0f9faa3a-4fd7-4798-9a70-ebd5760d5670/submissions/e6bac35e-4042-4a13-89d7-4412ec3150c1\\\", \\n \\\"uuid\\\": \\\"e6bac35e-4042-4a13-89d7-4412ec3150c1\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/0f9faa3a-4fd7-4798-9a70-ebd5760d5670/submissions/c7f7548c-6b0c-4ab0-b52d-00467f456a4a/download\\\", \\n \\\"filename\\\": \\\"2-penny-wise_telepathy-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/0f9faa3a-4fd7-4798-9a70-ebd5760d5670\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/0f9faa3a-4fd7-4798-9a70-ebd5760d5670/submissions/c7f7548c-6b0c-4ab0-b52d-00467f456a4a\\\", \\n \\\"uuid\\\": \\\"c7f7548c-6b0c-4ab0-b52d-00467f456a4a\\\"\\n }\\n ]\\n}\\n\", \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"DELETE\", \"path_query\": \"api/v1/sources/c3ddd7a5-6763-4ab8-978f-4329f9db2e55/submissions/bccb8dee-5a2f-4e6e-b640-a66fc47bff17\"}+2": "{\"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo1NToyNiBHTVQifX0.DqYDng.7XCpAhg6n3srTEg_3511rP-26o8; HttpOnly; Path=/\", \"Content-Type\": \"application/json\", \"Content-Length\": \"38\", \"Date\": \"Mon, 15 Oct 2018 10:55:26 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\"}, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"message\\\": \\\"Submission deleted\\\"\\n}\\n\", \"status\": 200}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/submissions\"}+3": "{\"body\": \"{\\n \\\"submissions\\\": [\\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/c3ddd7a5-6763-4ab8-978f-4329f9db2e55/submissions/4ef58591-2dda-4f6a-ac3a-415347d5ab46/download\\\", \\n \\\"filename\\\": \\\"2-palatable_flue-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/c3ddd7a5-6763-4ab8-978f-4329f9db2e55\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/c3ddd7a5-6763-4ab8-978f-4329f9db2e55/submissions/4ef58591-2dda-4f6a-ac3a-415347d5ab46\\\", \\n \\\"uuid\\\": \\\"4ef58591-2dda-4f6a-ac3a-415347d5ab46\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/0f9faa3a-4fd7-4798-9a70-ebd5760d5670/submissions/e6bac35e-4042-4a13-89d7-4412ec3150c1/download\\\", \\n \\\"filename\\\": \\\"1-penny-wise_telepathy-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/0f9faa3a-4fd7-4798-9a70-ebd5760d5670\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/0f9faa3a-4fd7-4798-9a70-ebd5760d5670/submissions/e6bac35e-4042-4a13-89d7-4412ec3150c1\\\", \\n \\\"uuid\\\": \\\"e6bac35e-4042-4a13-89d7-4412ec3150c1\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/0f9faa3a-4fd7-4798-9a70-ebd5760d5670/submissions/c7f7548c-6b0c-4ab0-b52d-00467f456a4a/download\\\", \\n \\\"filename\\\": \\\"2-penny-wise_telepathy-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/0f9faa3a-4fd7-4798-9a70-ebd5760d5670\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/0f9faa3a-4fd7-4798-9a70-ebd5760d5670/submissions/c7f7548c-6b0c-4ab0-b52d-00467f456a4a\\\", \\n \\\"uuid\\\": \\\"c7f7548c-6b0c-4ab0-b52d-00467f456a4a\\\"\\n }\\n ]\\n}\\n\", \"headers\": {\"Vary\": \"Cookie\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo1NToyNyBHTVQifX0.DqYDnw.lYtUHx_O_y-K-HRQsKjQMJDiylI; HttpOnly; Path=/\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Content-Length\": \"1546\", \"Content-Type\": \"application/json\", \"Date\": \"Mon, 15 Oct 2018 10:55:27 GMT\"}, \"version\": \"0.1.1\", \"status\": 200}"} \ No newline at end of file diff --git a/data/test_delete_submission_from_string.json b/data/test_delete_submission_from_string.json new file mode 100644 index 0000000..3272049 --- /dev/null +++ b/data/test_delete_submission_from_string.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/8bf7dc9e-f93a-4f30-9171-0733b886e2f4/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"shortish theodicy\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEck8BEACiZLEiPmPtpsi2ayPjHs2Yc3/wIMiwK8P8uq89NtnnpW+nTshj\\\\nzhgRtKLy72hVmXovlv+RLckUgCWoeOcKU+HZOHVHDnbs4Orvh8tWP3kObHrKWy0A\\\\nPu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dTH9Qoe2D8mIARvSNs38p2Vf3q5gdNCLG3Y\\\\nqI7uqm6ABAFA8C5rkh9Stm64yyCOAfWAteyX3ym48Avw2fAVaOO0I3YM0T8aPWyG\\\\nGMY6Y9Ir5QpPsPd7lLdvMmjf72ix+8mUON6OeUS/OWp5nWumRWCEj98awI51MgOC\\\\nd9qtxpm2lg0AKv2DhphRbPGwQnnLADqiAxDcr9wNROnov2jJw3b/1JMeb2gDWGq5\\\\nmaRjYdxYDfCIxkZA+lWY4isFtaltIjrSOUuhP8jhuDbH/wI1Qqrob2HILVbyQMaD\\\\n5zNkZlIZU3dfUJ/kuHIRg/xi+7aLpbC5/7IfWRC6PiLQBRaApyM8DM4jchWH90dJ\\\\n7PRXfY4paCSmmn4jKd/Vy2gj+XEdaT6E0CBFoo44tLd7OLAxVIunT8NWtQ8R3CrZ\\\\nBndspGnSyDRVW8G4s1U7tNttaqRVBWoXq6c4FWhC9qSL7m2GsNzfeQNfUn+GFhCc\\\\nm9u2HGDD6XQAEkLGlaMS4APme26ntuGKdBJaMoLG3Gk=\\\\n=hRQT\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:56:19.305183Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/8bf7dc9e-f93a-4f30-9171-0733b886e2f4/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/8bf7dc9e-f93a-4f30-9171-0733b886e2f4/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/8bf7dc9e-f93a-4f30-9171-0733b886e2f4/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/8bf7dc9e-f93a-4f30-9171-0733b886e2f4\\\", \\n \\\"uuid\\\": \\\"8bf7dc9e-f93a-4f30-9171-0733b886e2f4\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/a961f0ed-d0e5-4f25-badc-4cf220a71416/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"floored schnapps\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEclUBEAC+yFNCYrJ9O4ictZ2BCmqF4uNjVFVv+QpYc+1rqONdv9mH5XLt\\\\nMcxTwaUfNZopZ3+0iYBfm7P86dwJzPdDBE4hQ5taUZiPWf4dJaV8lUz/UcnEGT9O\\\\n+oLO/Ak7vRsZsRur40mmLaM2Gmz+dzUz0G8NLiVFTKJdY5lK9OZ18HELNbryeVaQ\\\\nXLIdmom2+OMK6nAgTj2ekBIFAXLV4jzSIK23L9bM+ZqJljonGnrKuILH9vhbrQpT\\\\nBxlTjezp+JhQaI/6QiwmZgFtBBl1bBMTKt3PCvXJwS1W3R5QseOp7pcaG8HYDpGu\\\\nb9BjC6GZYURVeehugGEw0rSe2qpuedCZMZfVrGAm6Aum7z0LKHJMvBopc0hLWZeY\\\\naRPy0pcxyyJUUFbgss9bld8+RC+gL8YvcYSio19EttrmprUNIrgGLEIOeTEAtE5Y\\\\njkjhvrzeZvpb2cQkyoelnoZeHnF+BKsmJbEBeCFmmW9Luu7fMpTnzrOQYVbSLVHu\\\\nowtadXvZaPG/7MJHzmEbdR+PmidU8cHbDA37pstBdUCjbq8pqTPjMzQOmD0/mxgF\\\\nnjVJQz7JVbiQF/HPaO1pBLjQyRYiPR3rARJCoW/U1CcTgzuASfw3j/lR8/UkW2ff\\\\nBCeBTLywxL1ZHqopi2ElejkSXWoYmbqPFLHJ08Cb5AkUFC8s5wooTgYf7QARAQAB\\\\ntHxBdXRvZ2VuZXJhdGVkIEtleSA8SURHMzRVNFdNSERWUjJKVU1CVkpDWklHWEVC\\\\nRkhVM0xKSkZIT01GTFc3N1ZJM0o2NUNYNVlPNVJZQ1ZHRUlaT1ZJVEFMVEJPQzZL\\\\nWlVVWUJQV0U1U1FCUlYzT0xDNEZSRllISVFKWT0+iQI/BBMBCgApBQJbxHJVAhsv\\\\nBQkB4UJrBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQGjQVeSld0t6CPhAA\\\\ntpm7fY89ZKI/dt6zH/7JxFOutVG2bvvyEkyHaCCu4fnsBdSkdhMPaMOtolyuSg5/\\\\nw8MbeYhVZAURbSXInwxfaF9Q6DvLPF9Q0Z9q/vgP6N5D183p3f+n3TZsL2tPJwbL\\\\nJI2vlqbhxCG2wlN8EgTRpzNEPYc67VxQIAx/ibiM9NGTBukmKX9KjPTJqwae7R1d\\\\nCZSNQsMozMDIuHXzLC8fM6oFU9Ik8y4umvzxnEE1nM8CCwY/se1D9JTvVsWRmjp9\\\\n8tZ4YOdyxK2kg9tAaLUKOyTuAvoF/YyTtV87zwerd+Xxx3D1QayVTnPPjtql1vJ/\\\\n3myaYVa4GU/BdQUQl/TWbnQS00P6NUsvPbsbjXRAUI7y6aW4s33Tx0lVY1uu5Lc8\\\\nzGii0wSUWWrFNf04QHIZlGyQk8FmIQeulcQn8h/l6YWE97SM/aMsnnsTD7HRJGnz\\\\n0x60mxFV1FmMFSMn3CuNd9AhGDtuC8MXCNglyMW+sGDG2Zma0D3F4/i8ESfs0kVA\\\\nRakUlJIsbkFmih0Ibb7VsnD65/PbKUjEp855Z/U579mS9378sX3kbD6jMubqq1XC\\\\nApDf46LJIO94FkKsZkDKTkgOXfsX4R+J6+MBzRIr63bZp1aa3n2NuchqwZyxxclu\\\\nD3opUPcNPNiNQM7KrnYH6FYR0163CadXOSuk20d2Nas=\\\\n=A3nz\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:56:24.989780Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/a961f0ed-d0e5-4f25-badc-4cf220a71416/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/a961f0ed-d0e5-4f25-badc-4cf220a71416/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/a961f0ed-d0e5-4f25-badc-4cf220a71416/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/a961f0ed-d0e5-4f25-badc-4cf220a71416\\\", \\n \\\"uuid\\\": \\\"a961f0ed-d0e5-4f25-badc-4cf220a71416\\\"\\n }\\n ]\\n}\\n\", \"version\": \"0.1.1\", \"headers\": {\"Content-Length\": \"5236\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo1NzoxMiBHTVQifX0.DqYECA.wm4pyK7Cu38V518Gm1wpIHubwM8; HttpOnly; Path=/\", \"Date\": \"Mon, 15 Oct 2018 10:57:12 GMT\", \"Content-Type\": \"application/json\", \"Vary\": \"Cookie\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\"}, \"status\": 200}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/8bf7dc9e-f93a-4f30-9171-0733b886e2f4/submissions\"}+2": "{\"body\": \"{\\n \\\"submissions\\\": [\\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/8bf7dc9e-f93a-4f30-9171-0733b886e2f4/submissions/2a5fcb1d-6512-4408-a572-21062f2df334/download\\\", \\n \\\"filename\\\": \\\"1-shortish_theodicy-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/8bf7dc9e-f93a-4f30-9171-0733b886e2f4\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/8bf7dc9e-f93a-4f30-9171-0733b886e2f4/submissions/2a5fcb1d-6512-4408-a572-21062f2df334\\\", \\n \\\"uuid\\\": \\\"2a5fcb1d-6512-4408-a572-21062f2df334\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/8bf7dc9e-f93a-4f30-9171-0733b886e2f4/submissions/5b149c74-8b6f-43b1-a142-2f740019d585/download\\\", \\n \\\"filename\\\": \\\"2-shortish_theodicy-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/8bf7dc9e-f93a-4f30-9171-0733b886e2f4\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/8bf7dc9e-f93a-4f30-9171-0733b886e2f4/submissions/5b149c74-8b6f-43b1-a142-2f740019d585\\\", \\n \\\"uuid\\\": \\\"5b149c74-8b6f-43b1-a142-2f740019d585\\\"\\n }\\n ]\\n}\\n\", \"headers\": {\"Content-Type\": \"application/json\", \"Date\": \"Mon, 15 Oct 2018 10:57:13 GMT\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo1NzoxMyBHTVQifX0.DqYECQ.4zSc7PL_zv50jK8c1sNOkUxcK2c; HttpOnly; Path=/\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Content-Length\": \"1037\", \"Vary\": \"Cookie\"}, \"status\": 200, \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"DELETE\", \"path_query\": \"api/v1/sources/8bf7dc9e-f93a-4f30-9171-0733b886e2f4/submissions/2a5fcb1d-6512-4408-a572-21062f2df334\"}+3": "{\"body\": \"{\\n \\\"message\\\": \\\"Submission deleted\\\"\\n}\\n\", \"version\": \"0.1.1\", \"status\": 200, \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo1NzoxMyBHTVQifX0.DqYECQ.4zSc7PL_zv50jK8c1sNOkUxcK2c; HttpOnly; Path=/\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Date\": \"Mon, 15 Oct 2018 10:57:13 GMT\", \"Content-Length\": \"38\", \"Content-Type\": \"application/json\"}}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/submissions\"}+4": "{\"status\": 200, \"version\": \"0.1.1\", \"headers\": {\"Content-Length\": \"1541\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo1NzoxNCBHTVQifX0.DqYECg.CK6x9P4C1Wb07zm7MGTTg6qb5ew; HttpOnly; Path=/\", \"Vary\": \"Cookie\", \"Date\": \"Mon, 15 Oct 2018 10:57:14 GMT\", \"Content-Type\": \"application/json\"}, \"body\": \"{\\n \\\"submissions\\\": [\\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/8bf7dc9e-f93a-4f30-9171-0733b886e2f4/submissions/5b149c74-8b6f-43b1-a142-2f740019d585/download\\\", \\n \\\"filename\\\": \\\"2-shortish_theodicy-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/8bf7dc9e-f93a-4f30-9171-0733b886e2f4\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/8bf7dc9e-f93a-4f30-9171-0733b886e2f4/submissions/5b149c74-8b6f-43b1-a142-2f740019d585\\\", \\n \\\"uuid\\\": \\\"5b149c74-8b6f-43b1-a142-2f740019d585\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/a961f0ed-d0e5-4f25-badc-4cf220a71416/submissions/0092e003-7bc6-41e2-8e30-ef41eae27746/download\\\", \\n \\\"filename\\\": \\\"1-floored_schnapps-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/a961f0ed-d0e5-4f25-badc-4cf220a71416\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/a961f0ed-d0e5-4f25-badc-4cf220a71416/submissions/0092e003-7bc6-41e2-8e30-ef41eae27746\\\", \\n \\\"uuid\\\": \\\"0092e003-7bc6-41e2-8e30-ef41eae27746\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/a961f0ed-d0e5-4f25-badc-4cf220a71416/submissions/bf2168b7-95a4-4c8a-bbc5-14738c38014b/download\\\", \\n \\\"filename\\\": \\\"2-floored_schnapps-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/a961f0ed-d0e5-4f25-badc-4cf220a71416\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/a961f0ed-d0e5-4f25-badc-4cf220a71416/submissions/bf2168b7-95a4-4c8a-bbc5-14738c38014b\\\", \\n \\\"uuid\\\": \\\"bf2168b7-95a4-4c8a-bbc5-14738c38014b\\\"\\n }\\n ]\\n}\\n\"}"} \ No newline at end of file diff --git a/data/test_download_reply.json b/data/test_download_reply.json new file mode 100644 index 0000000..58e7877 --- /dev/null +++ b/data/test_download_reply.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/replies\"}+1": "{\"version\": \"0.1.1\", \"body\": \"{\\n \\\"replies\\\": [\\n {\\n \\\"filename\\\": \\\"3-starry-eyed_shaping-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"bc175c3f-7559-46a6-b26b-d7c88ed5b136\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies/eb750345-5c40-4ced-acf2-6f8b27298c68\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"eb750345-5c40-4ced-acf2-6f8b27298c68\\\"\\n }, \\n {\\n \\\"filename\\\": \\\"4-starry-eyed_shaping-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"bc175c3f-7559-46a6-b26b-d7c88ed5b136\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies/3a1ae2ec-2e73-447c-be9f-cfcebdb4e38e\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"3a1ae2ec-2e73-447c-be9f-cfcebdb4e38e\\\"\\n }, \\n {\\n \\\"filename\\\": \\\"3-datable_syncopation-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"bc175c3f-7559-46a6-b26b-d7c88ed5b136\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies/a884c037-320d-40d0-9764-0af4241eb35b\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"a884c037-320d-40d0-9764-0af4241eb35b\\\"\\n }, \\n {\\n \\\"filename\\\": \\\"4-datable_syncopation-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"bc175c3f-7559-46a6-b26b-d7c88ed5b136\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies/7c8945b4-7f59-413d-994d-37a85da429b8\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"7c8945b4-7f59-413d-994d-37a85da429b8\\\"\\n }\\n ]\\n}\\n\", \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0MTowMSBHTVQifX0.DqYAPQ.Fh6DlFTKUWOGxS1xm6BjCiRyb4Y; HttpOnly; Path=/\", \"Content-Length\": \"1973\", \"Date\": \"Mon, 15 Oct 2018 10:41:01 GMT\", \"Content-Type\": \"application/json\", \"Vary\": \"Cookie\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\"}, \"status\": 200}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies/eb750345-5c40-4ced-acf2-6f8b27298c68/download\"}+2": "{\"body\": \"{\\\"filename\\\": \\\"80eed7a8-9fd6-4f95-baa4-fc740a7b1b5b\\\"}\", \"version\": \"0.1.1\", \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0MTowMiBHTVQifX0.DqYAPg.Opm78odeqggdZxWWC4NbqiiatMM; HttpOnly; Path=/\", \"Cache-Control\": \"public, max-age=43200\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Last-Modified\": \"Mon, 15 Oct 2018 10:40:29 GMT\", \"Content-Disposition\": \"attachment; filename=3-starry-eyed_shaping-reply.gpg\", \"Content-Type\": \"application/json\", \"Vary\": \"Cookie\", \"Etag\": \"\\\"sha256:c8a250d083f37d2ea184dc37b84b887af5a9e1c09f260049a8668ad91e9e05cd\\\"\", \"X-Origin-Content-Type\": \"application/json\", \"Expires\": \"Mon, 15 Oct 2018 22:41:02 GMT\", \"Date\": \"Mon, 15 Oct 2018 10:41:02 GMT\", \"Content-Length\": \"1116\"}, \"status\": 200}"} \ No newline at end of file diff --git a/data/test_download_submission.json b/data/test_download_submission.json new file mode 100644 index 0000000..a9a4517 --- /dev/null +++ b/data/test_download_submission.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/submissions\"}+1": "{\"version\": \"0.1.1\", \"body\": \"{\\n \\\"submissions\\\": [\\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d/download\\\", \\n \\\"filename\\\": \\\"1-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\", \\n \\\"uuid\\\": \\\"1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/98a79db7-2f34-4d08-ae00-6b4ab8a31b1b/download\\\", \\n \\\"filename\\\": \\\"2-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/98a79db7-2f34-4d08-ae00-6b4ab8a31b1b\\\", \\n \\\"uuid\\\": \\\"98a79db7-2f34-4d08-ae00-6b4ab8a31b1b\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions/8d71c240-6997-4836-9652-f3db95908372/download\\\", \\n \\\"filename\\\": \\\"1-datable_syncopation-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions/8d71c240-6997-4836-9652-f3db95908372\\\", \\n \\\"uuid\\\": \\\"8d71c240-6997-4836-9652-f3db95908372\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions/9d71e656-fae1-4f1c-b7dd-9c6a77b23ce8/download\\\", \\n \\\"filename\\\": \\\"2-datable_syncopation-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions/9d71e656-fae1-4f1c-b7dd-9c6a77b23ce8\\\", \\n \\\"uuid\\\": \\\"9d71e656-fae1-4f1c-b7dd-9c6a77b23ce8\\\"\\n }\\n ]\\n}\\n\", \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0NDoyOSBHTVQifX0.DqYBDQ.VdOIVvB-wp6QMdqIfO9JTh8nthw; HttpOnly; Path=/\", \"Date\": \"Mon, 15 Oct 2018 10:44:29 GMT\", \"Vary\": \"Cookie\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Content-Length\": \"2057\", \"Content-Type\": \"application/json\"}, \"status\": 200}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d/download\"}+2": "{\"headers\": {\"Cache-Control\": \"public, max-age=43200\", \"Content-Disposition\": \"attachment; filename=1-starry-eyed_shaping-msg.gpg\", \"Last-Modified\": \"Mon, 15 Oct 2018 10:40:29 GMT\", \"Vary\": \"Cookie\", \"Etag\": \"\\\"sha256:aacdde2b18d477a6f40d3c91d0e8ed41ddcfb3b4a2055535013cfaf859b29026\\\"\", \"Date\": \"Mon, 15 Oct 2018 10:44:30 GMT\", \"Content-Length\": \"604\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Expires\": \"Mon, 15 Oct 2018 22:44:30 GMT\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0NDozMCBHTVQifX0.DqYBDg.fiu8AhZ_1VJFS6XVzFe4iqMTcJs; HttpOnly; Path=/\", \"Content-Type\": \"application/json\", \"X-Origin-Content-Type\": \"application/json\"}, \"body\": \"{\\\"filename\\\": \\\"0b949046-0baa-4a23-bedf-088bfff66660\\\"}\", \"version\": \"0.1.1\", \"status\": 200}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\"}+3": "{\"version\": \"0.1.1\", \"body\": \"{\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d/download\\\", \\n \\\"filename\\\": \\\"1-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": true, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\", \\n \\\"uuid\\\": \\\"1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\"\\n}\\n\", \"status\": 200, \"headers\": {\"Content-Type\": \"application/json\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0NDozMSBHTVQifX0.DqYBDw.vt3ieWFsgnUGvJdeJgP9ewEhrtg; HttpOnly; Path=/\", \"Content-Length\": \"469\", \"Date\": \"Mon, 15 Oct 2018 10:44:31 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\"}}"} \ No newline at end of file diff --git a/data/test_error_unencrypted_reply.json b/data/test_error_unencrypted_reply.json new file mode 100644 index 0000000..fd3902d --- /dev/null +++ b/data/test_error_unencrypted_reply.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-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EGFQgCCQoLBBYCAwECHgECF4AACgkQ7lj3fkt9c+iMDRAA\\\\njjLrabgn2e2012+n5eIUus6cdHFQDM5R4TO6O6i6h7nvBGIA61j6tkKirG+8a/kT\\\\neCYdXu/nAgNbglkF0Gsg36KvipkQ7N003Cp9r0rofbA2ERSmT/SkCiMCDECGidx+\\\\n3YnCvEj5Xq+mqooKeyA3sRJe/TS/p0/RoY6hbXZhjcjnKfZL8030rL/wahQSdRXi\\\\nsEo2DdWum0E4ptqDZOv1E9Ek1xTL6sJ4hs83N1LI2TX5wcS58+y7di0KDTlxCFRn\\\\nd6Z5YQZWbssoHCMJt8J9kLg9vWfJSCERpuD/RDgCP5F2FwlC231aA2zrQBzU5kZt\\\\nUwElnIDI1WnZTXBz9y3FBpblohqr33XVsHZKl0yMbrT5JJPCZe30kZMz91p+mKZM\\\\nRV0C2gSKpylsUeGocaS5p0kf5QMTwDOlZoHJDRqYJVr0Uvcu8JMBFrNHVOU1iCPY\\\\nOTohSpG0VPGoNL7gog7npbbscZ8gWZiqykpGdyyL6N1I7JX0M49clt9RZHLbsMzA\\\\niOsEUF36WiPBzrchgwWPs+TEIQSQ2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"datable syncopation\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbp8BEADLk6fQ9ZYVCV1nzEB62akW3uK3ry/fVx37XHjJkP1ouqZOS4+X\\\\nyLy/TsHZEiP+NnWTAsMlkVlYxnO6KfsaEe/HMEXHddMV0B2Z5VMqmyPjotPXc/k3\\\\nzPe5HToQl917pPCbZE3uuHhJodqKwaieFhj2DoLouP8PAGDsJVu/9fxfEYHrPQgD\\\\ncwDVtj3gzM6iulIGgDVIIIAqI8CJl9qJTrqTVu34rBKwctSd+IEhWzmCZD02xt7a\\\\nTain0KHle+WACz0rdRf4uhkczufh9Q7TzSq1h0omZDZQq5CKVJQZg12Rka8hMs1w\\\\ney3/ZpQQMOnYAoWAj7Dhf365roh2crDL2SfXqGE3gYhZr9z/QdgY8BfKzhpQXpmh\\\\njmQPFxUXgJFh+xWqb/trY0tI/86WdDSS06o8U5qiYih3m0vrHSyi3S0m87P/Ce4V\\\\nOjnw6Nna5RCOynUquzK0vJx2m1dUbDsMSg810II49N10QIR/U8UwBcDgAiQhicki\\\\n+tTjDBfAP0lT8Xa8zF5bMMp4iNf7ouzpHkC4WyfbyzycJYLw38mfIrr5Ijdte/24\\\\nTKN+clhFgnNHA//C/n7ZmS91bkXfFWG8sYD4j1i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CW2erWALJnpJBaA+R4+8Y=\\\\n=5bhM\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:37.601298Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\"\\n }\\n ]\\n}\\n\", \"version\": \"0.1.1\", \"headers\": {\"Content-Length\": \"5241\", \"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Date\": \"Mon, 15 Oct 2018 10:45:06 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0NTowNiBHTVQifX0.DqYBMg.2aEX-76z4uuXPkirkKQaw0M7Xv8; HttpOnly; Path=/\"}, \"status\": 200}", "{\"body\": \"{\\\"reply\\\": \\\"hello\\\"}\", \"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"POST\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\"}+2": "{\"headers\": {\"Content-Type\": \"application/json\", \"Vary\": \"Cookie\", \"Content-Length\": \"56\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0NTowNiBHTVQifX0.DqYBMg.2aEX-76z4uuXPkirkKQaw0M7Xv8; HttpOnly; Path=/\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Date\": \"Mon, 15 Oct 2018 10:45:06 GMT\"}, \"body\": \"{\\n \\\"message\\\": \\\"You must encrypt replies client side\\\"\\n}\\n\", \"status\": 400, \"version\": \"0.1.1\"}"} \ No newline at end of file diff --git a/data/test_failed_single_source.json b/data/test_failed_single_source.json new file mode 100644 index 0000000..2a23aac --- /dev/null +++ b/data/test_failed_single_source.json @@ -0,0 +1 @@ +{"{\"body\": \"{\\\"passphrase\\\": \\\"correct horse battery staple profanity oil chewy\\\", \\\"username\\\": \\\"journalist\\\"}\", \"method\": \"POST\", \"path_query\": \"api/v1/token\"}+1": "", "{\"body\": \"{\\\"passphrase\\\": \\\"correct horse battery staple profanity oil chewy\\\", \\\"username\\\": \\\"journalist\\\"}\", \"method\": \"POST\", \"path_query\": \"api/v1/token\"}+2": "{\"body\": \"{\\n \\\"error\\\": \\\"Forbidden\\\", \\n \\\"message\\\": \\\"Token authentication failed.\\\"\\n}\\n\", \"headers\": {\"Content-Length\": \"73\", \"Date\": \"Mon, 15 Oct 2018 10:39:23 GMT\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjozOToyMyBHTVQifX0.DqX_2w.Sik0joWMM7s1KwgKUB7IUL7Q_tI; HttpOnly; Path=/\", \"Content-Type\": \"application/json\", \"Vary\": \"Cookie\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\"}, \"status\": 403, \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/not there\"}+1": "{\"status\": 404, \"version\": \"0.1.1\", \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjozOToyMyBHTVQifX0.DqX_2w.Sik0joWMM7s1KwgKUB7IUL7Q_tI; HttpOnly; Path=/\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Content-Type\": \"application/json\", \"Vary\": \"Cookie\", \"Content-Length\": \"166\", \"Date\": \"Mon, 15 Oct 2018 10:39:23 GMT\"}, \"body\": \"{\\n \\\"error\\\": \\\"Not Found\\\", \\n \\\"message\\\": \\\"The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.\\\"\\n}\\n\"}"} \ No newline at end of file diff --git a/data/test_flag_source.json b/data/test_flag_source.json new file mode 100644 index 0000000..5df96db --- /dev/null +++ b/data/test_flag_source.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"headers\": {\"Date\": \"Mon, 15 Oct 2018 10:46:04 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Content-Type\": \"application/json\", \"Vary\": \"Cookie\", \"Content-Length\": \"5241\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0NjowNCBHTVQifX0.DqYBbA.pLo6QcfFWehvNU7t8DTjQQm4MAQ; HttpOnly; Path=/\"}, \"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrg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0Gsg36KvipkQ7N003Cp9r0rofbA2ERSmT/SkCiMCDECGidx+\\\\n3YnCvEj5Xq+mqooKeyA3sRJe/TS/p0/RoY6hbXZhjcjnKfZL8030rL/wahQSdRXi\\\\nsEo2DdWum0E4ptqDZOv1E9Ek1xTL6sJ4hs83N1LI2TX5wcS58+y7di0KDTlxCFRn\\\\nd6Z5YQZWbssoHCMJt8J9kLg9vWfJSCERpuD/RDgCP5F2FwlC231aA2zrQBzU5kZt\\\\nUwElnIDI1WnZTXBz9y3FBpblohqr33XVsHZKl0yMbrT5JJPCZe30kZMz91p+mKZM\\\\nRV0C2gSKpylsUeGocaS5p0kf5QMTwDOlZoHJDRqYJVr0Uvcu8JMBFrNHVOU1iCPY\\\\nOTohSpG0VPGoNL7gog7npbbscZ8gWZiqykpGdyyL6N1I7JX0M49clt9RZHLbsMzA\\\\niOsEUF36WiPBzrchgwWPs+TEIQSQ2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"datable syncopation\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbp8BEADLk6fQ9ZYVCV1nzEB62akW3uK3ry/fVx37XHjJkP1ouqZOS4+X\\\\nyLy/TsHZEiP+NnWTAsMlkVlYxnO6KfsaEe/HMEXHddMV0B2Z5VMqmyPjotPXc/k3\\\\nzPe5HToQl917pPCbZE3uuHhJodqKwaieFhj2DoLouP8PAGDsJVu/9fxfEYHrPQgD\\\\ncwDVtj3gzM6iulIGgDVIIIAqI8CJl9qJTrqTVu34rBKwctSd+IEhWzmCZD02xt7a\\\\nTain0KHle+WACz0rdRf4uhkczufh9Q7TzSq1h0omZDZQq5CKVJQZg12Rka8hMs1w\\\\ney3/ZpQQMOnYAoWAj7Dhf365roh2crDL2SfXqGE3gYhZr9z/QdgY8BfKzhpQXpmh\\\\njmQPFxUXgJFh+xWqb/trY0tI/86WdDSS06o8U5qiYih3m0vrHSyi3S0m87P/Ce4V\\\\nOjnw6Nna5RCOynUquzK0vJx2m1dUbDsMSg810II49N10QIR/U8UwBcDgAiQhicki\\\\n+tTjDBfAP0lT8Xa8zF5bMMp4iNf7ouzpHkC4WyfbyzycJYLw38mfIrr5Ijdte/24\\\\nTKN+clhFgnNHA//C/n7ZmS91bkXfFWG8sYD4j1i0qDzVMKOT673ksDAXSMc2pupr\\\\nwi5F79T/5JnxAhWsIgFoaPIxYfL9NMnPFuqnWHNZfYXn1dRWr9GiArGzTQARAQAB\\\\ntHxBdXRvZ2VuZXJhdGVkIEtleSA8M04zQ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37.601298Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\"\\n }\\n ]\\n}\\n\", \"status\": 200, \"version\": \"0.1.1\"}", "{\"body\": null, \"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"POST\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/flag\"}+2": "{\"status\": 200, \"body\": \"{\\n \\\"message\\\": \\\"Source flagged for reply\\\"\\n}\\n\", \"headers\": {\"Date\": \"Mon, 15 Oct 2018 10:46:05 GMT\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0NjowNSBHTVQifX0.DqYBbQ.ndjLePg2lNaN6seJpMXz7Gh8el4; HttpOnly; Path=/\", \"Content-Length\": \"44\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\"}, \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\"}+3": "{\"status\": 200, \"headers\": {\"Content-Type\": \"application/json\", \"Vary\": \"Cookie\", \"Content-Length\": \"2531\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Date\": \"Mon, 15 Oct 2018 10:46:06 GMT\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0NjowNiBHTVQifX0.DqYBbg.M7lNhjK3NZ73r_G98uky_HSQlkY; HttpOnly; Path=/\"}, \"body\": \"{\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWpR1\\\\nimtSJ0fMEMg9JmlXvvznZOsv9KT4zviD+slxuUBknLcqhhDOxf4uWI5xvCsnTlJq\\\\ngVw9qtvQQH+6Dly/XuBvUIWbeCzmWrnG/fIk2APsCrl0t3bQgv6Iw4a1pUwILByF\\\\nQSeS1xSiCzzM8ADLuiWzjFaAQgQgA7KkFi+D7Cg3EPur1pLC60BhwXDrlJQ/yyzb\\\\n4D9iRZOdrUxrEtUCtyLimFuCixsT2XcD1TYdcM4mB1h6yUpEzyfIEgQ+OW5Ec4NO\\\\nErJ7U6X+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Rac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n}\\n\", \"version\": \"0.1.1\"}"} \ No newline at end of file diff --git a/data/test_get_all_replies.json b/data/test_get_all_replies.json new file mode 100644 index 0000000..ed6ab88 --- /dev/null +++ b/data/test_get_all_replies.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"headers\": {\"Date\": \"Mon, 15 Oct 2018 10:46:04 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Content-Type\": \"application/json\", \"Vary\": \"Cookie\", \"Content-Length\": \"5241\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0NjowNCBHTVQifX0.DqYBbA.pLo6QcfFWehvNU7t8DTjQQm4MAQ; HttpOnly; Path=/\"}, \"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWpR1\\\\nimtSJ0fMEMg9JmlXvvznZOsv9KT4zviD+slxuUBknLcqhhDOxf4uWI5xvCsnTlJq\\\\ngVw9qtvQQH+6Dly/XuBvUIWbeCzmWrnG/fIk2APsCrl0t3bQgv6Iw4a1pUwILByF\\\\nQSeS1xSiCzzM8ADLuiWzjFaAQgQgA7KkFi+D7Cg3EPur1pLC60BhwXDrlJQ/yyzb\\\\n4D9iRZOdrUxrEtUCtyLimFuCixsT2XcD1TYdcM4mB1h6yUpEzyfIEgQ+OW5Ec4NO\\\\nErJ7U6X+2kpH/E6u5szD2ZSVuQPBjY2riDpzJkAC1C7s0dU9JK8ini+Wce2EQt7+\\\\nBltumD5vEsZGcpTaKTLsQ9RWvtvg0A5Viv7q+/eLyvMFRzNF1Tp3EsI84QARAQAB\\\\ntHxBdXRvZ2VuZXJhdGVkIEtleSA8UDNIWTRTMkhPQkVGR1M0R0JTTExURkNNTFFL\\\\nU0lMR1g2NVlDRk42NlFVWVdSS1RIUFJOV1hWRjNFUU9XSkFFRFJZQlQ3QVlLQ1VX\\\\nWU1aSVFES0FHWVZZUEZMSU1NSlhOVFROUU9NQT0+iQI/BBMBCgApBQJbxG6cAhsv\\\\nBQkB4UYkBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQ7lj3fkt9c+iMDRAA\\\\njjLrabgn2e2012+n5eIUus6cdHFQDM5R4TO6O6i6h7nvBGIA61j6tkKirG+8a/kT\\\\neCYdXu/nAgNbglkF0Gsg36KvipkQ7N003Cp9r0rofbA2ERSmT/SkCiMCDECGidx+\\\\n3YnCvEj5Xq+mqooKeyA3sRJe/TS/p0/RoY6hbXZhjcjnKfZL8030rL/wahQSdRXi\\\\nsEo2DdWum0E4ptqDZOv1E9Ek1xTL6sJ4hs83N1LI2TX5wcS58+y7di0KDTlxCFRn\\\\nd6Z5YQZWbssoHCMJt8J9kLg9vWfJSCERpuD/RDgCP5F2FwlC231aA2zrQBzU5kZt\\\\nUwElnIDI1WnZTXBz9y3FBpblohqr33XVsHZKl0yMbrT5JJPCZe30kZMz91p+mKZM\\\\nRV0C2gSKpylsUeGocaS5p0kf5QMTwDOlZoHJDRqYJVr0Uvcu8JMBFrNHVOU1iCPY\\\\nOTohSpG0VPGoNL7gog7npbbscZ8gWZiqykpGdyyL6N1I7JX0M49clt9RZHLbsMzA\\\\niOsEUF36WiPBzrchgwWPs+TEIQSQ2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"datable syncopation\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbp8BEADLk6fQ9ZYVCV1nzEB62akW3uK3ry/fVx37XHjJkP1ouqZOS4+X\\\\nyLy/TsHZEiP+NnWTAsMlkVlYxnO6KfsaEe/HMEXHddMV0B2Z5VMqmyPjotPXc/k3\\\\nzPe5HToQl917pPCbZE3uuHhJodqKwaieFhj2DoLouP8PAGDsJVu/9fxfEYHrPQgD\\\\ncwDVtj3gzM6iulIGgDVIIIAqI8CJl9qJTrqTVu34rBKwctSd+IEhWzmCZD02xt7a\\\\nTain0KHle+WACz0rdRf4uhkczufh9Q7TzSq1h0omZDZQq5CKVJQZg12Rka8hMs1w\\\\ney3/ZpQQMOnYAoWAj7Dhf365roh2crDL2SfXqGE3gYhZr9z/QdgY8BfKzhpQXpmh\\\\njmQPFxUXgJFh+xWqb/trY0tI/86WdDSS06o8U5qiYih3m0vrHSyi3S0m87P/Ce4V\\\\nOjnw6Nna5RCOynUquzK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Knta++yC3j82AFonKYzagauLGjuGWb126pC4+iMaQIRq/QH5C5FE8s3g99sv7oIe\\\\nySMOLY+rZwsTyTxHw6knPNErEd80QUpH1vUt1x3SjnW+l9Lvqll5I7dU6WuM1Ufs\\\\n3QgpNC6OHYMzlW9adGmyVBCW2erWALJnpJBaA+R4+8Y=\\\\n=5bhM\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:37.601298Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\"\\n }\\n ]\\n}\\n\", \"status\": 200, \"version\": \"0.1.1\"}", "{\"body\": null, \"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"POST\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/flag\"}+2": "{\"status\": 200, \"body\": \"{\\n \\\"message\\\": \\\"Source flagged for reply\\\"\\n}\\n\", \"headers\": {\"Date\": \"Mon, 15 Oct 2018 10:46:05 GMT\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0NjowNSBHTVQifX0.DqYBbQ.ndjLePg2lNaN6seJpMXz7Gh8el4; HttpOnly; Path=/\", \"Content-Length\": \"44\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\"}, \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\"}+3": "{\"status\": 200, \"headers\": {\"Content-Type\": \"application/json\", \"Vary\": \"Cookie\", \"Content-Length\": \"2531\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Date\": \"Mon, 15 Oct 2018 10:46:06 GMT\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0NjowNiBHTVQifX0.DqYBbg.M7lNhjK3NZ73r_G98uky_HSQlkY; HttpOnly; Path=/\"}, \"body\": \"{\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWpR1\\\\nimtSJ0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l0yMbrT5JJPCZe30kZMz91p+mKZM\\\\nRV0C2gSKpylsUeGocaS5p0kf5QMTwDOlZoHJDRqYJVr0Uvcu8JMBFrNHVOU1iCPY\\\\nOTohSpG0VPGoNL7gog7npbbscZ8gWZiqykpGdyyL6N1I7JX0M49clt9RZHLbsMzA\\\\niOsEUF36WiPBzrchgwWPs+TEIQSQ2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n}\\n\", \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/replies\"}+1": "{\"version\": \"0.1.1\", \"headers\": {\"Date\": \"Mon, 15 Oct 2018 10:47:53 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Content-Length\": \"1973\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Nzo1MyBHTVQifX0.DqYB2Q.mRegrKhwxli3z0JUEhBO6l9xgcw; HttpOnly; Path=/\", \"Content-Type\": \"application/json\"}, \"body\": \"{\\n \\\"replies\\\": [\\n {\\n \\\"filename\\\": \\\"3-starry-eyed_shaping-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"bc175c3f-7559-46a6-b26b-d7c88ed5b136\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies/eb750345-5c40-4ced-acf2-6f8b27298c68\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"eb750345-5c40-4ced-acf2-6f8b27298c68\\\"\\n }, \\n {\\n \\\"filename\\\": \\\"4-starry-eyed_shaping-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"bc175c3f-7559-46a6-b26b-d7c88ed5b136\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies/3a1ae2ec-2e73-447c-be9f-cfcebdb4e38e\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"3a1ae2ec-2e73-447c-be9f-cfcebdb4e38e\\\"\\n }, \\n {\\n \\\"filename\\\": \\\"3-datable_syncopation-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"bc175c3f-7559-46a6-b26b-d7c88ed5b136\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies/a884c037-320d-40d0-9764-0af4241eb35b\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"a884c037-320d-40d0-9764-0af4241eb35b\\\"\\n }, \\n {\\n \\\"filename\\\": \\\"4-datable_syncopation-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"bc175c3f-7559-46a6-b26b-d7c88ed5b136\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies/7c8945b4-7f59-413d-994d-37a85da429b8\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"7c8945b4-7f59-413d-994d-37a85da429b8\\\"\\n }\\n ]\\n}\\n\", \"status\": 200}"} \ No newline at end of file diff --git a/data/test_get_all_submissions.json b/data/test_get_all_submissions.json new file mode 100644 index 0000000..35cfa0e --- /dev/null +++ b/data/test_get_all_submissions.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"headers\": {\"Date\": \"Mon, 15 Oct 2018 10:46:04 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Content-Type\": \"application/json\", \"Vary\": \"Cookie\", \"Content-Length\": \"5241\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0NjowNCBHTVQifX0.DqYBbA.pLo6QcfFWehvNU7t8DTjQQm4MAQ; HttpOnly; Path=/\"}, \"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWpR1\\\\nimtSJ0fMEMg9JmlXvvznZOsv9KT4zviD+slxuUBknLcqhhDOxf4uWI5xvCsnTlJq\\\\ngVw9qtvQQH+6Dly/XuBvUIWbeCzmWrnG/fIk2APsCrl0t3bQgv6Iw4a1pUwILByF\\\\nQSeS1xSiCzzM8ADLuiWzjFaAQgQgA7KkFi+D7Cg3EPur1pLC60BhwXDrlJQ/yyzb\\\\n4D9iRZOdrUxrEtUCtyLimFuCixsT2XcD1TYdcM4mB1h6yUpEzyfIEgQ+OW5Ec4NO\\\\nErJ7U6X+2kpH/E6u5szD2ZSVuQPBjY2riDpzJkAC1C7s0dU9JK8ini+Wce2EQt7+\\\\nBltumD5vEsZGcpTaKTLsQ9RWvtvg0A5Viv7q+/eLyvMFRzNF1Tp3EsI84QARAQAB\\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\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"datable syncopation\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbp8BEADLk6fQ9ZYVCV1nzEB62akW3uK3ry/fVx37XHjJkP1ouqZOS4+X\\\\nyLy/TsHZEiP+NnWTAsMlkVlYxnO6KfsaEe/HMEXHddMV0B2Z5VMqmyPjotPXc/k3\\\\nzPe5HToQl917pPCbZE3uuHhJodqKwaieFhj2DoLouP8PAGDsJVu/9fxfEYHrPQgD\\\\ncwDVtj3gzM6iulIGgDVIIIAqI8CJl9qJTrqTVu34rBKwctSd+IEhWzmCZD02xt7a\\\\nTain0KHle+WACz0rdRf4uhkczufh9Q7TzSq1h0omZDZQq5CKVJQZg12Rka8hMs1w\\\\ney3/ZpQQMOnYAoWAj7Dhf365roh2crDL2SfXqGE3gYhZr9z/QdgY8BfKzhpQXpmh\\\\njmQPF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gzGQR1\\\\nb4ZtplZorLWHN3YeQqx8UkR1+Cy6DKUUFWCku4HnSLoMQldnrgEhySz1e2r5P7gl\\\\nKnta++yC3j82AFonKYzagauLGjuGWb126pC4+iMaQIRq/QH5C5FE8s3g99sv7oIe\\\\nySMOLY+rZwsTyTxHw6knPNErEd80QUpH1vUt1x3SjnW+l9Lvqll5I7dU6WuM1Ufs\\\\n3QgpNC6OHYMzlW9adGmyVBCW2erWALJnpJBaA+R4+8Y=\\\\n=5bhM\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:37.601298Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\"\\n }\\n ]\\n}\\n\", \"status\": 200, \"version\": \"0.1.1\"}", "{\"body\": null, \"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"POST\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/flag\"}+2": "{\"status\": 200, \"body\": \"{\\n \\\"message\\\": \\\"Source flagged for reply\\\"\\n}\\n\", \"headers\": {\"Date\": \"Mon, 15 Oct 2018 10:46:05 GMT\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0NjowNSBHTVQifX0.DqYBbQ.ndjLePg2lNaN6seJpMXz7Gh8el4; HttpOnly; Path=/\", \"Content-Length\": \"44\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\"}, \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\"}+3": "{\"status\": 200, \"headers\": {\"Content-Type\": \"application/json\", \"Vary\": \"Cookie\", \"Content-Length\": \"2531\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Date\": \"Mon, 15 Oct 2018 10:46:06 GMT\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0NjowNiBHTVQifX0.DqYBbg.M7lNhjK3NZ73r_G98uky_HSQlkY; HttpOnly; Path=/\"}, \"body\": \"{\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq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Lg9vWfJSCERpuD/RDgCP5F2FwlC231aA2zrQBzU5kZt\\\\nUwElnIDI1WnZTXBz9y3FBpblohqr33XVsHZKl0yMbrT5JJPCZe30kZMz91p+mKZM\\\\nRV0C2gSKpylsUeGocaS5p0kf5QMTwDOlZoHJDRqYJVr0Uvcu8JMBFrNHVOU1iCPY\\\\nOTohSpG0VPGoNL7gog7npbbscZ8gWZiqykpGdyyL6N1I7JX0M49clt9RZHLbsMzA\\\\niOsEUF36WiPBzrchgwWPs+TEIQSQ2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n}\\n\", \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/replies\"}+1": "{\"version\": \"0.1.1\", \"headers\": {\"Date\": \"Mon, 15 Oct 2018 10:47:53 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Content-Length\": \"1973\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Nzo1MyBHTVQifX0.DqYB2Q.mRegrKhwxli3z0JUEhBO6l9xgcw; HttpOnly; Path=/\", \"Content-Type\": \"application/json\"}, \"body\": \"{\\n \\\"replies\\\": [\\n {\\n \\\"filename\\\": \\\"3-starry-eyed_shaping-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"bc175c3f-7559-46a6-b26b-d7c88ed5b136\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies/eb750345-5c40-4ced-acf2-6f8b27298c68\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"eb750345-5c40-4ced-acf2-6f8b27298c68\\\"\\n }, \\n {\\n \\\"filename\\\": \\\"4-starry-eyed_shaping-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"bc175c3f-7559-46a6-b26b-d7c88ed5b136\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies/3a1ae2ec-2e73-447c-be9f-cfcebdb4e38e\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"3a1ae2ec-2e73-447c-be9f-cfcebdb4e38e\\\"\\n }, \\n {\\n \\\"filename\\\": \\\"3-datable_syncopation-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"bc175c3f-7559-46a6-b26b-d7c88ed5b136\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies/a884c037-320d-40d0-9764-0af4241eb35b\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"a884c037-320d-40d0-9764-0af4241eb35b\\\"\\n }, \\n {\\n \\\"filename\\\": \\\"4-datable_syncopation-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"bc175c3f-7559-46a6-b26b-d7c88ed5b136\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies/7c8945b4-7f59-413d-994d-37a85da429b8\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"7c8945b4-7f59-413d-994d-37a85da429b8\\\"\\n }\\n ]\\n}\\n\", \"status\": 200}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/submissions\"}+1": "{\"headers\": {\"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Date\": \"Mon, 15 Oct 2018 10:47:55 GMT\", \"Vary\": \"Cookie\", \"Content-Length\": \"2056\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Nzo1NSBHTVQifX0.DqYB2w.ZsC9zECVmUJJOiftGbF0aXddmrI; HttpOnly; Path=/\", \"Content-Type\": \"application/json\"}, \"body\": \"{\\n \\\"submissions\\\": [\\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d/download\\\", \\n \\\"filename\\\": \\\"1-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": true, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\", \\n \\\"uuid\\\": \\\"1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/98a79db7-2f34-4d08-ae00-6b4ab8a31b1b/download\\\", \\n \\\"filename\\\": \\\"2-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/98a79db7-2f34-4d08-ae00-6b4ab8a31b1b\\\", \\n \\\"uuid\\\": \\\"98a79db7-2f34-4d08-ae00-6b4ab8a31b1b\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions/8d71c240-6997-4836-9652-f3db95908372/download\\\", \\n \\\"filename\\\": \\\"1-datable_syncopation-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions/8d71c240-6997-4836-9652-f3db95908372\\\", \\n \\\"uuid\\\": \\\"8d71c240-6997-4836-9652-f3db95908372\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions/9d71e656-fae1-4f1c-b7dd-9c6a77b23ce8/download\\\", \\n \\\"filename\\\": \\\"2-datable_syncopation-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions/9d71e656-fae1-4f1c-b7dd-9c6a77b23ce8\\\", \\n \\\"uuid\\\": \\\"9d71e656-fae1-4f1c-b7dd-9c6a77b23ce8\\\"\\n }\\n ]\\n}\\n\", \"status\": 200, \"version\": \"0.1.1\"}"} \ No newline at end of file diff --git a/data/test_get_current_user.json b/data/test_get_current_user.json new file mode 100644 index 0000000..54ab139 --- /dev/null +++ b/data/test_get_current_user.json @@ -0,0 +1 @@ +{"{\"body\": \"{\\\"passphrase\\\": \\\"correct horse battery staple profanity oil chewy\\\", \\\"username\\\": \\\"journalist\\\"}\", \"method\": \"POST\", \"path_query\": \"api/v1/token\"}+1": "", "{\"body\": \"{\\\"passphrase\\\": \\\"correct horse battery staple profanity oil chewy\\\", \\\"username\\\": \\\"journalist\\\"}\", \"method\": \"POST\", \"path_query\": \"api/v1/token\"}+2": "{\"version\": \"0.1.1\", \"status\": 403, \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjozOToyOSBHTVQifX0.DqX_4Q.aaA3zESPgWZWhqRfJBX2EIJ1JOY; HttpOnly; Path=/\", \"Content-Type\": \"application/json\", \"Vary\": \"Cookie\", \"Content-Length\": \"73\", \"Date\": \"Mon, 15 Oct 2018 10:39:29 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\"}, \"body\": \"{\\n \\\"error\\\": \\\"Forbidden\\\", \\n \\\"message\\\": \\\"Token authentication failed.\\\"\\n}\\n\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/user\"}+1": "{\"version\": \"0.1.1\", \"status\": 200, \"headers\": {\"Content-Length\": \"151\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjozOTozMCBHTVQifX0.DqX_4g.ZqmyWKUsiiLezPcUqa_RXv6rfn4; HttpOnly; Path=/\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Date\": \"Mon, 15 Oct 2018 10:39:30 GMT\"}, \"body\": \"{\\n \\\"is_admin\\\": true, \\n \\\"last_login\\\": \\\"2018-10-15T10:39:03.762045Z\\\", \\n \\\"username\\\": \\\"journalist\\\", \\n \\\"uuid\\\": \\\"eb4a8050-7eb7-496a-ae75-1ef66db677bc\\\"\\n}\\n\"}"} \ No newline at end of file diff --git a/data/test_get_replies_from_source.json b/data/test_get_replies_from_source.json new file mode 100644 index 0000000..7a9db5e --- /dev/null +++ b/data/test_get_replies_from_source.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_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bxG6cAhsv\\\\nBQkB4UYkBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQ7lj3fkt9c+iMDRAA\\\\njjLrabgn2e2012+n5eIUus6cdHFQDM5R4TO6O6i6h7nvBGIA61j6tkKirG+8a/kT\\\\neCYdXu/nAgNbglkF0Gsg36KvipkQ7N003Cp9r0rofbA2ERSmT/SkCiMCDECGidx+\\\\n3YnCvEj5Xq+mqooKeyA3sRJe/TS/p0/RoY6hbXZhjcjnKfZL8030rL/wahQSdRXi\\\\nsEo2DdWum0E4ptqDZOv1E9Ek1xTL6sJ4hs83N1LI2TX5wcS58+y7di0KDTlxCFRn\\\\nd6Z5YQZWbssoHCMJt8J9kLg9vWfJSCERpuD/RDgCP5F2FwlC231aA2zrQBzU5kZt\\\\nUwElnIDI1WnZTXBz9y3FBpblohqr33XVsHZKl0yMbrT5JJPCZe30kZMz91p+mKZM\\\\nRV0C2gSKpylsUeGocaS5p0kf5QMTwDOlZoHJDRqYJVr0Uvcu8JMBFrNHVOU1iCPY\\\\nOTohSpG0VPGoNL7gog7npbbscZ8gWZiqykpGdyyL6N1I7JX0M49clt9RZHLbsMzA\\\\niOsEUF36WiPBzrchgwWPs+TEIQSQ2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"datable syncopation\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbp8BEADLk6fQ9ZYVCV1nzEB62akW3uK3ry/fVx37XHjJkP1ouqZOS4+X\\\\nyLy/TsHZEiP+NnWTAsMlkVlYxnO6KfsaEe/HMEXHddMV0B2Z5VMqmyPjotPXc/k3\\\\nzPe5HToQl917pPCbZE3uuHhJodqKwaieFhj2DoLouP8PAGDsJVu/9fxfEYHrPQgD\\\\ncwDVtj3gzM6iulIGgDVIIIAqI8CJl9qJTrqTVu34rBKwctSd+IEhWzmCZD02xt7a\\\\nTain0KHle+WACz0rdRf4uhkczufh9Q7TzSq1h0omZDZQq5CKVJQZg12Rka8hMs1w\\\\ney3/ZpQQMOnYAoWAj7Dhf365roh2crDL2SfXqGE3gYhZr9z/QdgY8BfKzhpQXpmh\\\\njmQPFxUXgJFh+xWqb/trY0tI/86WdDSS06o8U5qiYih3m0vrHSyi3S0m87P/Ce4V\\\\nOjnw6Nna5RCOynUquzK0vJx2m1dUbDsMSg810II49N10QIR/U8UwBcDgAiQhicki\\\\n+tTjDBfAP0lT8Xa8zF5bMMp4iNf7ouzpHkC4WyfbyzycJYLw38mfIrr5Ijdte/24\\\\nTKN+cl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M1Ufs\\\\n3QgpNC6OHYMzlW9adGmyVBCW2erWALJnpJBaA+R4+8Y=\\\\n=5bhM\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:37.601298Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\"\\n }\\n ]\\n}\\n\", \"status\": 200, \"version\": \"0.1.1\", \"headers\": {\"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Content-Length\": \"5240\", \"Date\": \"Mon, 15 Oct 2018 10:46:25 GMT\", \"Vary\": \"Cookie\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0NjoyNSBHTVQifX0.DqYBgQ.dharDRwzCrb64xPr3M6G8N5uA7E; HttpOnly; Path=/\"}}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\"}+2": "{\"body\": \"{\\n \\\"replies\\\": [\\n {\\n \\\"filename\\\": \\\"3-starry-eyed_shaping-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"bc175c3f-7559-46a6-b26b-d7c88ed5b136\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies/eb750345-5c40-4ced-acf2-6f8b27298c68\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"eb750345-5c40-4ced-acf2-6f8b27298c68\\\"\\n }, \\n {\\n \\\"filename\\\": \\\"4-starry-eyed_shaping-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"bc175c3f-7559-46a6-b26b-d7c88ed5b136\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies/3a1ae2ec-2e73-447c-be9f-cfcebdb4e38e\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"3a1ae2ec-2e73-447c-be9f-cfcebdb4e38e\\\"\\n }\\n ]\\n}\\n\", \"headers\": {\"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0NjoyNiBHTVQifX0.DqYBgg.t1ZrcNszo0nyGfeB7QXUg1Nym4k; HttpOnly; Path=/\", \"Vary\": \"Cookie\", \"Content-Length\": \"997\", \"Content-Type\": \"application/json\", \"Date\": \"Mon, 15 Oct 2018 10:46:26 GMT\"}, \"version\": \"0.1.1\", \"status\": 200}"} \ No newline at end of file diff --git a/data/test_get_reply_from_source.json b/data/test_get_reply_from_source.json new file mode 100644 index 0000000..1dadf79 --- /dev/null +++ b/data/test_get_reply_from_source.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"headers\": {\"Date\": \"Mon, 15 Oct 2018 10:46:46 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo0NiBHTVQifX0.DqYBlg.AOU-MLcIop4rWxjsG1ETiZmDjHE; HttpOnly; Path=/\", \"Content-Length\": \"5240\", \"Content-Type\": \"application/json\", \"Vary\": \"Cookie\"}, \"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWpR1\\\\nimtSJ0fMEMg9JmlXvvznZOsv9KT4zviD+slxuUBknLcqhhDOxf4uWI5xvCsnTlJq\\\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wDOlZoHJDRqYJVr0Uvcu8JMBFrNHVOU1iCPY\\\\nOTohSpG0VPGoNL7gog7npbbscZ8gWZiqykpGdyyL6N1I7JX0M49clt9RZHLbsMzA\\\\niOsEUF36WiPBzrchgwWPs+TEIQSQ2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"datable syncopation\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbp8BEADLk6fQ9ZYVCV1nzEB62akW3uK3ry/fVx37XHjJkP1ouqZ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o7zr3qyiJL+UmftNKZiQN26\\\\nb8bvf4vvhHOMlj4Z46wxuBBZlDfJSa+geXeObxLOkhnwpFCBxIf6qErIliwCcIGj\\\\ntrHSJcChPthaKzfE2iZaQyIWaVQ4i5N9aJ61yhFyz/zBulCVBhr++5QVki8rav0+\\\\nrzxDQADly6vWPctiHh4giMfeZq1yOXfV5D62w6WhM0hmpQwikuxu9CkSEmcKbtjS\\\\nh/2BgfZGUMwyX90cJfFgKSB7mWYyxiMQLLehtVH7utMY8tmvBHQCMmwmm06XLLYa\\\\nuRDnh/NKIfGsYaAdoH5DoQohZeEpOk8jj047zZ4yJYLQFSF1Couo/wSYp2gzGQR1\\\\nb4ZtplZorLWHN3YeQqx8UkR1+Cy6DKUUFWCku4HnSLoMQldnrgEhySz1e2r5P7gl\\\\nKnta++yC3j82AFonKYzagauLGjuGWb126pC4+iMaQIRq/QH5C5FE8s3g99sv7oIe\\\\nySMOLY+rZwsTyTxHw6knPNErEd80QUpH1vUt1x3SjnW+l9Lvqll5I7dU6WuM1Ufs\\\\n3QgpNC6OHYMzlW9adGmyVBCW2erWALJnpJBaA+R4+8Y=\\\\n=5bhM\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:37.601298Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\"\\n }\\n ]\\n}\\n\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\"}+2": "{\"headers\": {\"Content-Type\": \"application/json\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo0NyBHTVQifX0.DqYBlw.KU8mEDN47bUI2Rs8wNp8CyTAGrY; HttpOnly; Path=/\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Content-Length\": \"997\", \"Date\": \"Mon, 15 Oct 2018 10:46:47 GMT\"}, \"body\": \"{\\n \\\"replies\\\": [\\n {\\n \\\"filename\\\": \\\"3-starry-eyed_shaping-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"bc175c3f-7559-46a6-b26b-d7c88ed5b136\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies/eb750345-5c40-4ced-acf2-6f8b27298c68\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"eb750345-5c40-4ced-acf2-6f8b27298c68\\\"\\n }, \\n {\\n \\\"filename\\\": \\\"4-starry-eyed_shaping-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"bc175c3f-7559-46a6-b26b-d7c88ed5b136\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies/3a1ae2ec-2e73-447c-be9f-cfcebdb4e38e\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"3a1ae2ec-2e73-447c-be9f-cfcebdb4e38e\\\"\\n }\\n ]\\n}\\n\", \"status\": 200, \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies/eb750345-5c40-4ced-acf2-6f8b27298c68\"}+3": "{\"status\": 200, \"headers\": {\"Content-Length\": \"446\", \"Date\": \"Mon, 15 Oct 2018 10:46:48 GMT\", \"Content-Type\": \"application/json\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo0OCBHTVQifX0.DqYBmA.1ta1GvpAOgufHGL-ENfK38e2HUo; HttpOnly; Path=/\", \"Vary\": \"Cookie\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\"}, \"body\": \"{\\n \\\"filename\\\": \\\"3-starry-eyed_shaping-reply.gpg\\\", \\n \\\"is_deleted_by_source\\\": false, \\n \\\"journalist_username\\\": \\\"journalist\\\", \\n \\\"journalist_uuid\\\": \\\"bc175c3f-7559-46a6-b26b-d7c88ed5b136\\\", \\n \\\"reply_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies/eb750345-5c40-4ced-acf2-6f8b27298c68\\\", \\n \\\"size\\\": 1116, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"eb750345-5c40-4ced-acf2-6f8b27298c68\\\"\\n}\\n\", \"version\": \"0.1.1\"}"} \ No newline at end of file diff --git a/data/test_get_single_source.json b/data/test_get_single_source.json new file mode 100644 index 0000000..04f24a4 --- /dev/null +++ b/data/test_get_single_source.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"headers\": {\"Content-Length\": \"5240\", \"Date\": \"Mon, 15 Oct 2018 10:46:58 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OCBHTVQifX0.DqYBog.fYCzbmIRuA6u65naeoL3F6rUSoc; HttpOnly; Path=/\"}, \"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWpR1\\\\nimtSJ0fMEMg9JmlXvvznZOsv9KT4zviD+slxuUBknLcqhhDOxf4uWI5xvCsnTl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f5QMTwDOlZoHJDRqYJVr0Uvcu8JMBFrNHVOU1iCPY\\\\nOTohSpG0VPGoNL7gog7npbbscZ8gWZiqykpGdyyL6N1I7JX0M49clt9RZHLbsMzA\\\\niOsEUF36WiPBzrchgwWPs+TEIQSQ2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"datable syncopation\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbp8BEADLk6fQ9ZYVCV1nzEB62akW3uK3ry/fVx37XHjJkP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AqBPFo7zr3qyiJL+UmftNKZiQN26\\\\nb8bvf4vvhHOMlj4Z46wxuBBZlDfJSa+geXeObxLOkhnwpFCBxIf6qErIliwCcIGj\\\\ntrHSJcChPthaKzfE2iZaQyIWaVQ4i5N9aJ61yhFyz/zBulCVBhr++5QVki8rav0+\\\\nrzxDQADly6vWPctiHh4giMfeZq1yOXfV5D62w6WhM0hmpQwikuxu9CkSEmcKbtjS\\\\nh/2BgfZGUMwyX90cJfFgKSB7mWYyxiMQLLehtVH7utMY8tmvBHQCMmwmm06XLLYa\\\\nuRDnh/NKIfGsYaAdoH5DoQohZeEpOk8jj047zZ4yJYLQFSF1Couo/wSYp2gzGQR1\\\\nb4ZtplZorLWHN3YeQqx8UkR1+Cy6DKUUFWCku4HnSLoMQldnrgEhySz1e2r5P7gl\\\\nKnta++yC3j82AFonKYzagauLGjuGWb126pC4+iMaQIRq/QH5C5FE8s3g99sv7oIe\\\\nySMOLY+rZwsTyTxHw6knPNErEd80QUpH1vUt1x3SjnW+l9Lvqll5I7dU6WuM1Ufs\\\\n3QgpNC6OHYMzlW9adGmyVBCW2erWALJnpJBaA+R4+8Y=\\\\n=5bhM\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:37.601298Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\"\\n }\\n ]\\n}\\n\", \"status\": 200, \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\"}+2": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWpR1\\\\nimtSJ0fMEMg9JmlXvvznZOsv9KT4zviD+slxuUBknLcqhhDOxf4uWI5xvCsnTlJq\\\\ngVw9qtvQQH+6Dly/XuBvUIWbeCzmWrnG/fIk2APsCrl0t3bQgv6Iw4a1pUwILByF\\\\nQSeS1xSiCzzM8ADLuiWzjFaAQgQgA7KkFi+D7Cg3EPur1pLC60BhwXDrlJQ/yyzb\\\\n4D9iRZOdrUxrEtUCtyLimFuCixsT2XcD1TYdcM4mB1h6yUpEzyfIEgQ+OW5Ec4NO\\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qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n}\\n\", \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OSBHTVQifX0.DqYBow.94-bnoWUIk3LjjHM9jBQJ7z6eFg; HttpOnly; Path=/\", \"Date\": \"Mon, 15 Oct 2018 10:46:59 GMT\", \"Vary\": \"Cookie\", \"Content-Length\": \"2531\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\"}}"} \ No newline at end of file diff --git a/data/test_get_single_source_from_string.json b/data/test_get_single_source_from_string.json new file mode 100644 index 0000000..04f24a4 --- /dev/null +++ b/data/test_get_single_source_from_string.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"headers\": {\"Content-Length\": \"5240\", \"Date\": \"Mon, 15 Oct 2018 10:46:58 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OCBHTVQifX0.DqYBog.fYCzbmIRuA6u65naeoL3F6rUSoc; HttpOnly; Path=/\"}, \"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWpR1\\\\nimtSJ0fMEMg9JmlXvvznZOsv9KT4zviD+slxuUBknLcqhhDOxf4uWI5xvCsnTlJq\\\\ngVw9qtvQQH+6Dly/XuBvUIWbeCzmWrnG/fIk2APsCrl0t3bQgv6Iw4a1pUwILByF\\\\nQSeS1xSiCzzM8ADLuiWzjFaAQgQgA7KkFi+D7Cg3EPur1pLC60BhwXDrlJQ/yyzb\\\\n4D9iRZOdrUxrEtUCtyLimFuCixsT2X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\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"datable syncopation\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbp8BEADLk6fQ9ZYVCV1nzEB62akW3uK3ry/fVx37XHjJkP1ouqZOS4+X\\\\nyLy/TsHZEiP+NnWTAsMlkVlYxnO6KfsaEe/HMEXHddMV0B2Z5VMqmyPjotPXc/k3\\\\nzPe5HToQl917pPCbZE3uuHhJodqKwaieFhj2DoLouP8PAGDsJVu/9fxfEYHrPQgD\\\\ncwDVtj3gzM6iulIGgDVIIIAqI8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ctiHh4giMfeZq1yOXfV5D62w6WhM0hmpQwikuxu9CkSEmcKbtjS\\\\nh/2BgfZGUMwyX90cJfFgKSB7mWYyxiMQLLehtVH7utMY8tmvBHQCMmwmm06XLLYa\\\\nuRDnh/NKIfGsYaAdoH5DoQohZeEpOk8jj047zZ4yJYLQFSF1Couo/wSYp2gzGQR1\\\\nb4ZtplZorLWHN3YeQqx8UkR1+Cy6DKUUFWCku4HnSLoMQldnrgEhySz1e2r5P7gl\\\\nKnta++yC3j82AFonKYzagauLGjuGWb126pC4+iMaQIRq/QH5C5FE8s3g99sv7oIe\\\\nySMOLY+rZwsTyTxHw6knPNErEd80QUpH1vUt1x3SjnW+l9Lvqll5I7dU6WuM1Ufs\\\\n3QgpNC6OHYMzlW9adGmyVBCW2erWALJnpJBaA+R4+8Y=\\\\n=5bhM\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:37.601298Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\"\\n }\\n ]\\n}\\n\", \"status\": 200, \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\"}+2": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWpR1\\\\nimtSJ0fMEMg9JmlXvvznZOsv9KT4zviD+slxuUBknLcqhhDOxf4uWI5xvCsnTlJq\\\\ngVw9qtvQQH+6Dly/XuBvUIWbeCzmWrnG/fIk2APsCrl0t3bQgv6Iw4a1pUwILByF\\\\nQSeS1xSiCzzM8ADLuiWzjFaAQgQgA7KkFi+D7Cg3EPur1pLC60BhwXDrlJQ/yyzb\\\\n4D9iRZOdrUxrEtUCtyLimFuCixsT2XcD1TYdcM4mB1h6yUpEzyfIEgQ+OW5Ec4NO\\\\nErJ7U6X+2kpH/E6u5szD2ZSVuQPBjY2riDpzJkAC1C7s0dU9JK8ini+Wce2EQt7+\\\\nBltumD5vEsZGcpTaKTLsQ9RWvtvg0A5Viv7q+/eLyvMFRzNF1Tp3EsI84QARAQAB\\\\ntHxBdXRvZ2VuZXJhdGVkIEtleSA8UDNIWT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10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n}\\n\", \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OSBHTVQifX0.DqYBow.94-bnoWUIk3LjjHM9jBQJ7z6eFg; HttpOnly; Path=/\", \"Date\": \"Mon, 15 Oct 2018 10:46:59 GMT\", \"Vary\": \"Cookie\", \"Content-Length\": \"2531\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\"}}"} \ No newline at end of file diff --git a/data/test_get_sources.json b/data/test_get_sources.json new file mode 100644 index 0000000..04f24a4 --- /dev/null +++ b/data/test_get_sources.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"headers\": {\"Content-Length\": \"5240\", \"Date\": \"Mon, 15 Oct 2018 10:46:58 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OCBHTVQifX0.DqYBog.fYCzbmIRuA6u65naeoL3F6rUSoc; HttpOnly; Path=/\"}, \"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWpR1\\\\nimtSJ0fMEMg9JmlXvvznZOsv9KT4zviD+slxuUBknLcqhhDOxf4uWI5xvCsnTlJq\\\\ngVw9qtvQQH+6Dly/XuBvUIWbeCzmWrnG/fIk2APsCrl0t3bQgv6Iw4a1pUwILByF\\\\nQSeS1xSiCzzM8ADLuiWzjFaAQgQgA7KkFi+D7Cg3EPur1pLC60BhwXDrlJQ/yyzb\\\\n4D9iRZOdrUxrEtUCtyLimFuCixsT2XcD1TYdcM4mB1h6yUpEzyfIEgQ+OW5Ec4NO\\\\nErJ7U6X+2kpH/E6u5szD2ZSVuQPBjY2riDpzJkAC1C7s0dU9JK8ini+Wce2EQt7+\\\\nBltumD5vEsZGcpTaKTLsQ9RWvtvg0A5Viv7q+/eLyvMFRzNF1Tp3EsI84QARAQAB\\\\ntHxBdXRvZ2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, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"datable syncopation\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbp8BEADLk6fQ9ZYVCV1nzEB62akW3uK3ry/fVx37XHjJkP1ouqZOS4+X\\\\nyLy/TsHZEiP+NnWTAsMlkVlYxnO6KfsaEe/HMEXHddMV0B2Z5VMqmyPjotPXc/k3\\\\nzPe5HToQl917pPCbZE3uuHhJodqKwaieFhj2DoLouP8PAGDsJVu/9fxfEYHrPQgD\\\\ncwDVtj3gzM6iulIGgDVIIIAqI8CJl9qJTrqTVu34rBKwctSd+IEhWzmCZD02xt7a\\\\nTain0KHle+WACz0rdRf4uhkczufh9Q7TzSq1h0omZDZQq5CKVJQZg12Rka8hMs1w\\\\ney3/ZpQQMOnYAoWAj7Dhf365roh2crDL2SfXqGE3gYhZr9z/QdgY8BfKzhpQXpmh\\\\njmQPFxUXgJFh+xWqb/tr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ZtplZorLWHN3YeQqx8UkR1+Cy6DKUUFWCku4HnSLoMQldnrgEhySz1e2r5P7gl\\\\nKnta++yC3j82AFonKYzagauLGjuGWb126pC4+iMaQIRq/QH5C5FE8s3g99sv7oIe\\\\nySMOLY+rZwsTyTxHw6knPNErEd80QUpH1vUt1x3SjnW+l9Lvqll5I7dU6WuM1Ufs\\\\n3QgpNC6OHYMzlW9adGmyVBCW2erWALJnpJBaA+R4+8Y=\\\\n=5bhM\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:37.601298Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\"\\n }\\n ]\\n}\\n\", \"status\": 200, \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\"}+2": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry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gEGFQgCCQoLBBYCAwECHgECF4AACgkQ7lj3fkt9c+iMDRAA\\\\njjLrabgn2e2012+n5eIUus6cdHFQDM5R4TO6O6i6h7nvBGIA61j6tkKirG+8a/kT\\\\neCYdXu/nAgNbglkF0Gsg36KvipkQ7N003Cp9r0rofbA2ERSmT/SkCiMCDECGidx+\\\\n3YnCvEj5Xq+mqooKeyA3sRJe/TS/p0/RoY6hbXZhjcjnKfZL8030rL/wahQSdRXi\\\\nsEo2DdWum0E4ptqDZOv1E9Ek1xTL6sJ4hs83N1LI2TX5wcS58+y7di0KDTlxCFRn\\\\nd6Z5YQZWbssoHCMJt8J9kLg9vWfJSCERpuD/RDgCP5F2FwlC231aA2zrQBzU5kZt\\\\nUwElnIDI1WnZTXBz9y3FBpblohqr33XVsHZKl0yMbrT5JJPCZe30kZMz91p+mKZM\\\\nRV0C2gSKpylsUeGocaS5p0kf5QMTwDOlZoHJDRqYJVr0Uvcu8JMBFrNHVOU1iCPY\\\\nOTohSpG0VPGoNL7gog7npbbscZ8gWZiqykpGdyyL6N1I7JX0M49clt9RZHLbsMzA\\\\niOsEUF36WiPBzrchgwWPs+TEIQSQ2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n}\\n\", \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OSBHTVQifX0.DqYBow.94-bnoWUIk3LjjHM9jBQJ7z6eFg; HttpOnly; Path=/\", \"Date\": \"Mon, 15 Oct 2018 10:46:59 GMT\", \"Vary\": \"Cookie\", \"Content-Length\": \"2531\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\"}}"} \ No newline at end of file diff --git a/data/test_get_submission.json b/data/test_get_submission.json new file mode 100644 index 0000000..49dc599 --- /dev/null +++ b/data/test_get_submission.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"headers\": {\"Content-Length\": \"5240\", \"Date\": \"Mon, 15 Oct 2018 10:46:58 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OCBHTVQifX0.DqYBog.fYCzbmIRuA6u65naeoL3F6rUSoc; HttpOnly; Path=/\"}, \"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \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\\\\nBQkB4UYkBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQ7lj3fkt9c+iMDRAA\\\\njjLrabgn2e2012+n5eIUus6cdHFQDM5R4TO6O6i6h7nvBGIA61j6tkKirG+8a/kT\\\\neCYdXu/nAgNbglkF0Gsg36KvipkQ7N003Cp9r0rofbA2ERSmT/SkCiMCDECGidx+\\\\n3YnCvEj5Xq+mqooKeyA3sRJe/TS/p0/RoY6hbXZhjcjnKfZL8030rL/wahQSdRXi\\\\nsEo2DdWum0E4ptqDZOv1E9Ek1xTL6sJ4hs83N1LI2TX5wcS58+y7di0KDTlxCFRn\\\\nd6Z5YQZWbssoHCMJt8J9kLg9vWfJSCERpuD/RDgCP5F2FwlC231aA2zrQBzU5kZt\\\\nUwElnIDI1WnZTXBz9y3FBpblohqr33XVsHZKl0yMbrT5JJPCZe30kZMz91p+mKZM\\\\nRV0C2gSKpylsUeGocaS5p0kf5QMTwDOlZoHJDRqYJVr0Uvcu8JMBFrNHVOU1iCPY\\\\nOTohSpG0VPGoNL7gog7npbbscZ8gWZiqykpGdyyL6N1I7JX0M49clt9RZHLbsMzA\\\\niOsEUF36WiPBzrchgwWPs+TEIQSQ2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"datable syncopation\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbp8BEADLk6fQ9ZYVCV1nzEB62akW3uK3ry/fVx37XHjJkP1ouqZOS4+X\\\\nyLy/TsHZEiP+NnWTAsMlkVlYxnO6KfsaEe/HMEXHddMV0B2Z5VMqmyPjotPXc/k3\\\\nzPe5HToQl917pPCbZE3uuHhJodqKwaieFhj2DoLouP8PAGDsJVu/9fxfEYHrPQgD\\\\ncwDVtj3gzM6iulIGgDVIIIAqI8CJl9qJTrqTVu34rBKwctSd+IEhWzmCZD02xt7a\\\\nTain0KHle+WACz0rdRf4uhkczufh9Q7TzSq1h0omZDZQq5CKVJQZg12Rka8hMs1w\\\\ney3/ZpQQMOnYAoWAj7Dhf365roh2crDL2SfXqGE3gYhZr9z/QdgY8BfKzhpQXpmh\\\\njmQPFxUXgJFh+xWqb/trY0tI/86WdDSS06o8U5qiYih3m0vrHSyi3S0m87P/Ce4V\\\\nOjnw6Nna5RCOynUquzK0vJx2m1dUbDsMSg810II49N10QIR/U8UwBcDgAiQhicki\\\\n+tTjDBfAP0lT8Xa8zF5bMMp4iNf7ouzpHkC4WyfbyzycJYLw38mfIrr5Ijdte/24\\\\nTKN+clhFgnNHA//C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\n3QgpNC6OHYMzlW9adGmyVBCW2erWALJnpJBaA+R4+8Y=\\\\n=5bhM\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:37.601298Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\"\\n }\\n ]\\n}\\n\", \"status\": 200, \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\"}+2": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWS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mqooKeyA3sRJe/TS/p0/RoY6hbXZhjcjnKfZL8030rL/wahQSdRXi\\\\nsEo2DdWum0E4ptqDZOv1E9Ek1xTL6sJ4hs83N1LI2TX5wcS58+y7di0KDTlxCFRn\\\\nd6Z5YQZWbssoHCMJt8J9kLg9vWfJSCERpuD/RDgCP5F2FwlC231aA2zrQBzU5kZt\\\\nUwElnIDI1WnZTXBz9y3FBpblohqr33XVsHZKl0yMbrT5JJPCZe30kZMz91p+mKZM\\\\nRV0C2gSKpylsUeGocaS5p0kf5QMTwDOlZoHJDRqYJVr0Uvcu8JMBFrNHVOU1iCPY\\\\nOTohSpG0VPGoNL7gog7npbbscZ8gWZiqykpGdyyL6N1I7JX0M49clt9RZHLbsMzA\\\\niOsEUF36WiPBzrchgwWPs+TEIQSQ2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n}\\n\", \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OSBHTVQifX0.DqYBow.94-bnoWUIk3LjjHM9jBQJ7z6eFg; HttpOnly; Path=/\", \"Date\": \"Mon, 15 Oct 2018 10:46:59 GMT\", \"Vary\": \"Cookie\", \"Content-Length\": \"2531\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\"}}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\"}+2": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"submissions\\\": [\\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d/download\\\", \\n \\\"filename\\\": \\\"1-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": true, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\", \\n \\\"uuid\\\": \\\"1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/98a79db7-2f34-4d08-ae00-6b4ab8a31b1b/download\\\", \\n \\\"filename\\\": \\\"2-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/98a79db7-2f34-4d08-ae00-6b4ab8a31b1b\\\", \\n \\\"uuid\\\": \\\"98a79db7-2f34-4d08-ae00-6b4ab8a31b1b\\\"\\n }\\n ]\\n}\\n\", \"headers\": {\"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowMSBHTVQifX0.DqYB4Q.gZRj3stxg_oPAqFYMJhffTcu8hM; HttpOnly; Path=/\", \"Content-Length\": \"1040\", \"Date\": \"Mon, 15 Oct 2018 10:48:01 GMT\"}}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\"}+3": "{\"headers\": {\"Content-Length\": \"469\", \"Vary\": \"Cookie\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowMiBHTVQifX0.DqYB4g.NvIYBZdgnQqn9Kwtqxum-6miRaQ; HttpOnly; Path=/\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Date\": \"Mon, 15 Oct 2018 10:48:02 GMT\"}, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d/download\\\", \\n \\\"filename\\\": \\\"1-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": true, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\", \\n \\\"uuid\\\": \\\"1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\"\\n}\\n\", \"status\": 200}"} \ No newline at end of file diff --git a/data/test_get_submission_from_string.json b/data/test_get_submission_from_string.json new file mode 100644 index 0000000..49dc599 --- /dev/null +++ b/data/test_get_submission_from_string.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"headers\": {\"Content-Length\": \"5240\", \"Date\": \"Mon, 15 Oct 2018 10:46:58 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OCBHTVQifX0.DqYBog.fYCzbmIRuA6u65naeoL3F6rUSoc; HttpOnly; Path=/\"}, \"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWB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j5Xq+mqooKeyA3sRJe/TS/p0/RoY6hbXZhjcjnKfZL8030rL/wahQSdRXi\\\\nsEo2DdWum0E4ptqDZOv1E9Ek1xTL6sJ4hs83N1LI2TX5wcS58+y7di0KDTlxCFRn\\\\nd6Z5YQZWbssoHCMJt8J9kLg9vWfJSCERpuD/RDgCP5F2FwlC231aA2zrQBzU5kZt\\\\nUwElnIDI1WnZTXBz9y3FBpblohqr33XVsHZKl0yMbrT5JJPCZe30kZMz91p+mKZM\\\\nRV0C2gSKpylsUeGocaS5p0kf5QMTwDOlZoHJDRqYJVr0Uvcu8JMBFrNHVOU1iCPY\\\\nOTohSpG0VPGoNL7gog7npbbscZ8gWZiqykpGdyyL6N1I7JX0M49clt9RZHLbsMzA\\\\niOsEUF36WiPBzrchgwWPs+TEIQSQ2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"datable syncopation\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbp8BEADLk6fQ9ZYVCV1nzEB62akW3uK3ry/fVx37XHjJkP1ouqZOS4+X\\\\nyLy/TsHZEiP+NnWTAsMlkVlYxnO6KfsaEe/HMEXHddMV0B2Z5VMqmyPjotPXc/k3\\\\nzPe5HToQl917pPCbZE3uuHhJodqKwaieFhj2DoLouP8PAGDsJVu/9fxfEYHrPQgD\\\\ncwDVtj3gzM6iulIGgDVIIIAqI8CJl9qJTrqTVu34rBKwctSd+IEhWzmCZD02xt7a\\\\nTain0KHle+WACz0rdRf4uhkczufh9Q7TzSq1h0omZDZQq5CKVJQZg12Rka8hMs1w\\\\ney3/ZpQQMOnYAoWAj7Dhf365roh2crDL2SfXqGE3gYhZr9z/QdgY8BfKzhpQXpmh\\\\njmQPFxUXgJFh+xWqb/trY0tI/86WdDSS06o8U5qiYih3m0vrHSyi3S0m87P/Ce4V\\\\nOjnw6Nna5RCOynUquzK0vJx2m1dUbDsMSg810II49N10QIR/U8UwBcDgAiQhicki\\\\n+tTjDBfAP0lT8Xa8zF5bMMp4iNf7ouzpHkC4WyfbyzycJYLw38mfIrr5Ijdte/24\\\\nTKN+clhFgnNHA//C/n7ZmS91bkXfFWG8sYD4j1i0qDzVMKOT673ksDAXSMc2pupr\\\\nwi5F79T/5JnxAhWsIgFoaPIxYfL9NMnPFuqnWHNZfYXn1dRWr9GiArGzTQARAQAB\\\\ntHxBdXRvZ2VuZXJhdGVkIEtleSA8M04zQVVIWVhWSFVGR0E2QzJUV0tZVDQ1QUVH\\\\nWFBVUUxTTjY2SjI1RlgyN0tOQktPSVRDNkhMQllRWTRKN0JMVjNENU41QUVCRkxO\\\\nQVZVNU1UTzdFWkJOSldMRVNJSUYyTUZOT1VNQT0+iQI/BBMBCgApBQJbxG6fAhsv\\\\nBQkB4UYhBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQn6EGbC8pRwXMYw//\\\\nfHo/CLGbpyaUGDh6jCU6ZtstCuWwjiyG4gawCS/f5WTShmcamGDN0L3QVzFK10cq\\\\nDpnJ1bb53bG9lqTdUapru6YEYV/F+snRGxUXAqBPFo7zr3qyiJL+UmftNKZiQN26\\\\nb8bvf4vvhHOMlj4Z46wxuBBZlDfJSa+geXeObxLOkhnwpFCBxIf6qErIliwCcIGj\\\\ntrHSJcChPthaKzfE2iZaQyIWaVQ4i5N9aJ61yhFyz/zBulCVBhr++5QVki8rav0+\\\\nrzxDQADly6vWPctiHh4giMfeZq1yOXfV5D62w6WhM0hmpQwikuxu9CkSEmcKbtjS\\\\nh/2BgfZGUMwyX90cJfFgKSB7mWYyxiMQLLehtVH7utMY8tmvBHQCMmwmm06XLLYa\\\\nuRDnh/NKIfGsYaAdoH5DoQohZeEpOk8jj047zZ4yJYLQFSF1Couo/wSYp2gzGQR1\\\\nb4ZtplZorLWHN3YeQqx8UkR1+Cy6DKUUFWCku4HnSLoMQldnrgEhySz1e2r5P7gl\\\\nKnta++yC3j82AFonKYzagauLGjuGWb126pC4+iMaQIRq/QH5C5FE8s3g99sv7oIe\\\\nySMOLY+rZwsTyTxHw6knPNErEd80QUpH1vUt1x3SjnW+l9Lvqll5I7dU6WuM1Ufs\\\\n3QgpNC6OHYMzlW9adGmyVBCW2erWALJnpJBaA+R4+8Y=\\\\n=5bhM\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:37.601298Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\"\\n }\\n ]\\n}\\n\", \"status\": 200, \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\"}+2": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghs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y3FBpblohqr33XVsHZKl0yMbrT5JJPCZe30kZMz91p+mKZM\\\\nRV0C2gSKpylsUeGocaS5p0kf5QMTwDOlZoHJDRqYJVr0Uvcu8JMBFrNHVOU1iCPY\\\\nOTohSpG0VPGoNL7gog7npbbscZ8gWZiqykpGdyyL6N1I7JX0M49clt9RZHLbsMzA\\\\niOsEUF36WiPBzrchgwWPs+TEIQSQ2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n}\\n\", \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OSBHTVQifX0.DqYBow.94-bnoWUIk3LjjHM9jBQJ7z6eFg; HttpOnly; Path=/\", \"Date\": \"Mon, 15 Oct 2018 10:46:59 GMT\", \"Vary\": \"Cookie\", \"Content-Length\": \"2531\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\"}}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\"}+2": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"submissions\\\": [\\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d/download\\\", \\n \\\"filename\\\": \\\"1-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": true, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\", \\n \\\"uuid\\\": \\\"1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/98a79db7-2f34-4d08-ae00-6b4ab8a31b1b/download\\\", \\n \\\"filename\\\": \\\"2-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/98a79db7-2f34-4d08-ae00-6b4ab8a31b1b\\\", \\n \\\"uuid\\\": \\\"98a79db7-2f34-4d08-ae00-6b4ab8a31b1b\\\"\\n }\\n ]\\n}\\n\", \"headers\": {\"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowMSBHTVQifX0.DqYB4Q.gZRj3stxg_oPAqFYMJhffTcu8hM; HttpOnly; Path=/\", \"Content-Length\": \"1040\", \"Date\": \"Mon, 15 Oct 2018 10:48:01 GMT\"}}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\"}+3": "{\"headers\": {\"Content-Length\": \"469\", \"Vary\": \"Cookie\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowMiBHTVQifX0.DqYB4g.NvIYBZdgnQqn9Kwtqxum-6miRaQ; HttpOnly; Path=/\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Date\": \"Mon, 15 Oct 2018 10:48:02 GMT\"}, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d/download\\\", \\n \\\"filename\\\": \\\"1-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": true, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\", \\n \\\"uuid\\\": \\\"1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\"\\n}\\n\", \"status\": 200}"} \ No newline at end of file diff --git a/data/test_get_submissions.json b/data/test_get_submissions.json new file mode 100644 index 0000000..49dc599 --- /dev/null +++ b/data/test_get_submissions.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"headers\": {\"Content-Length\": \"5240\", \"Date\": \"Mon, 15 Oct 2018 10:46:58 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OCBHTVQifX0.DqYBog.fYCzbmIRuA6u65naeoL3F6rUSoc; HttpOnly; Path=/\"}, \"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWp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Bpblohqr33XVsHZKl0yMbrT5JJPCZe30kZMz91p+mKZM\\\\nRV0C2gSKpylsUeGocaS5p0kf5QMTwDOlZoHJDRqYJVr0Uvcu8JMBFrNHVOU1iCPY\\\\nOTohSpG0VPGoNL7gog7npbbscZ8gWZiqykpGdyyL6N1I7JX0M49clt9RZHLbsMzA\\\\niOsEUF36WiPBzrchgwWPs+TEIQSQ2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"datable syncopation\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLO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gawCS/f5WTShmcamGDN0L3QVzFK10cq\\\\nDpnJ1bb53bG9lqTdUapru6YEYV/F+snRGxUXAqBPFo7zr3qyiJL+UmftNKZiQN26\\\\nb8bvf4vvhHOMlj4Z46wxuBBZlDfJSa+geXeObxLOkhnwpFCBxIf6qErIliwCcIGj\\\\ntrHSJcChPthaKzfE2iZaQyIWaVQ4i5N9aJ61yhFyz/zBulCVBhr++5QVki8rav0+\\\\nrzxDQADly6vWPctiHh4giMfeZq1yOXfV5D62w6WhM0hmpQwikuxu9CkSEmcKbtjS\\\\nh/2BgfZGUMwyX90cJfFgKSB7mWYyxiMQLLehtVH7utMY8tmvBHQCMmwmm06XLLYa\\\\nuRDnh/NKIfGsYaAdoH5DoQohZeEpOk8jj047zZ4yJYLQFSF1Couo/wSYp2gzGQR1\\\\nb4ZtplZorLWHN3YeQqx8UkR1+Cy6DKUUFWCku4HnSLoMQldnrgEhySz1e2r5P7gl\\\\nKnta++yC3j82AFonKYzagauLGjuGWb126pC4+iMaQIRq/QH5C5FE8s3g99sv7oIe\\\\nySMOLY+rZwsTyTxHw6knPNErEd80QUpH1vUt1x3SjnW+l9Lvqll5I7dU6WuM1Ufs\\\\n3QgpNC6OHYMzlW9adGmyVBCW2erWALJnpJBaA+R4+8Y=\\\\n=5bhM\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:37.601298Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\"\\n }\\n ]\\n}\\n\", \"status\": 200, \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\"}+2": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWpR1\\\\nimtSJ0fMEMg9JmlXvvznZOsv9KT4zviD+slxuUBknLcqhhDOxf4uWI5xvCsnTlJq\\\\ngVw9qtvQQH+6Dly/XuBvUIWbeCzmWrnG/fIk2APsCrl0t3bQgv6Iw4a1pUwILByF\\\\nQSeS1xSiCzzM8ADLuiWzjFaAQgQgA7KkFi+D7Cg3EPur1pLC60BhwXDrlJQ/yyzb\\\\n4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EDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n}\\n\", \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OSBHTVQifX0.DqYBow.94-bnoWUIk3LjjHM9jBQJ7z6eFg; HttpOnly; Path=/\", \"Date\": \"Mon, 15 Oct 2018 10:46:59 GMT\", \"Vary\": \"Cookie\", \"Content-Length\": \"2531\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\"}}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\"}+2": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"submissions\\\": [\\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d/download\\\", \\n \\\"filename\\\": \\\"1-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": true, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\", \\n \\\"uuid\\\": \\\"1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/98a79db7-2f34-4d08-ae00-6b4ab8a31b1b/download\\\", \\n \\\"filename\\\": \\\"2-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/98a79db7-2f34-4d08-ae00-6b4ab8a31b1b\\\", \\n \\\"uuid\\\": \\\"98a79db7-2f34-4d08-ae00-6b4ab8a31b1b\\\"\\n }\\n ]\\n}\\n\", \"headers\": {\"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowMSBHTVQifX0.DqYB4Q.gZRj3stxg_oPAqFYMJhffTcu8hM; HttpOnly; Path=/\", \"Content-Length\": \"1040\", \"Date\": \"Mon, 15 Oct 2018 10:48:01 GMT\"}}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\"}+3": "{\"headers\": {\"Content-Length\": \"469\", \"Vary\": \"Cookie\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowMiBHTVQifX0.DqYB4g.NvIYBZdgnQqn9Kwtqxum-6miRaQ; HttpOnly; Path=/\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Date\": \"Mon, 15 Oct 2018 10:48:02 GMT\"}, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d/download\\\", \\n \\\"filename\\\": \\\"1-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": true, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\", \\n \\\"uuid\\\": \\\"1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\"\\n}\\n\", \"status\": 200}"} \ No newline at end of file diff --git a/data/test_get_wrong_submissions.json b/data/test_get_wrong_submissions.json new file mode 100644 index 0000000..477a4a4 --- /dev/null +++ b/data/test_get_wrong_submissions.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"headers\": {\"Content-Length\": \"5240\", \"Date\": \"Mon, 15 Oct 2018 10:46:58 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OCBHTVQifX0.DqYBog.fYCzbmIRuA6u65naeoL3F6rUSoc; HttpOnly; Path=/\"}, \"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWpR1\\\\nimtSJ0fMEMg9JmlXvvznZOsv9KT4zviD+slxuUBknLcqhhDOxf4uWI5xvCsnTlJq\\\\ngVw9qtvQQH+6Dly/XuBvUIWbeCzmWrnG/fIk2APsCrl0t3bQgv6Iw4a1pUwILByF\\\\nQSeS1xSiCzzM8ADLuiWzjFaAQgQgA7KkFi+D7Cg3EPur1pLC60BhwXDrlJQ/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Q2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"datable syncopation\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbp8BEADLk6fQ9ZYVCV1nzEB62akW3uK3ry/fVx37XHjJkP1ouqZOS4+X\\\\nyLy/TsHZEiP+NnWTAsMlkVlYxnO6KfsaEe/HMEXHddMV0B2Z5VMqmyPjotPXc/k3\\\\nzPe5HToQl917pPCbZE3uuHhJodqKwaieFhj2DoLouP8PAGDsJVu/9fxfE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yz/zBulCVBhr++5QVki8rav0+\\\\nrzxDQADly6vWPctiHh4giMfeZq1yOXfV5D62w6WhM0hmpQwikuxu9CkSEmcKbtjS\\\\nh/2BgfZGUMwyX90cJfFgKSB7mWYyxiMQLLehtVH7utMY8tmvBHQCMmwmm06XLLYa\\\\nuRDnh/NKIfGsYaAdoH5DoQohZeEpOk8jj047zZ4yJYLQFSF1Couo/wSYp2gzGQR1\\\\nb4ZtplZorLWHN3YeQqx8UkR1+Cy6DKUUFWCku4HnSLoMQldnrgEhySz1e2r5P7gl\\\\nKnta++yC3j82AFonKYzagauLGjuGWb126pC4+iMaQIRq/QH5C5FE8s3g99sv7oIe\\\\nySMOLY+rZwsTyTxHw6knPNErEd80QUpH1vUt1x3SjnW+l9Lvqll5I7dU6WuM1Ufs\\\\n3QgpNC6OHYMzlW9adGmyVBCW2erWALJnpJBaA+R4+8Y=\\\\n=5bhM\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:37.601298Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\"\\n }\\n ]\\n}\\n\", \"status\": 200, \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\"}+2": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWpR1\\\\nimtSJ0fMEMg9JmlXvvznZOsv9KT4zviD+slxuUBknLcqhhDOxf4uWI5xvCsnTlJq\\\\ngVw9qtvQQH+6Dly/XuBvUIWbeCzmWrnG/fIk2APsCrl0t3bQgv6Iw4a1pUwILByF\\\\nQSeS1xSiCzzM8ADLuiWzjFaAQgQgA7KkFi+D7Cg3EPur1pLC60BhwXDrlJQ/yyzb\\\\n4D9iRZOdrUxrEtUCtyLimFuCixsT2XcD1TYdcM4mB1h6yUpEzyfIEgQ+OW5Ec4NO\\\\nErJ7U6X+2kpH/E6u5szD2ZSVuQPBjY2riDpzJkAC1C7s0dU9JK8ini+Wce2EQt7+\\\\nBltumD5vEsZGcpTaKTLsQ9RWvtvg0A5Viv7q+/eLyvMFRzNF1Tp3EsI84QARAQAB\\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\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n}\\n\", \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OSBHTVQifX0.DqYBow.94-bnoWUIk3LjjHM9jBQJ7z6eFg; HttpOnly; Path=/\", \"Date\": \"Mon, 15 Oct 2018 10:46:59 GMT\", \"Vary\": \"Cookie\", \"Content-Length\": \"2531\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\"}}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\"}+2": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"submissions\\\": [\\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d/download\\\", \\n \\\"filename\\\": \\\"1-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": true, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\", \\n \\\"uuid\\\": \\\"1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/98a79db7-2f34-4d08-ae00-6b4ab8a31b1b/download\\\", \\n \\\"filename\\\": \\\"2-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/98a79db7-2f34-4d08-ae00-6b4ab8a31b1b\\\", \\n \\\"uuid\\\": \\\"98a79db7-2f34-4d08-ae00-6b4ab8a31b1b\\\"\\n }\\n ]\\n}\\n\", \"headers\": {\"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowMSBHTVQifX0.DqYB4Q.gZRj3stxg_oPAqFYMJhffTcu8hM; HttpOnly; Path=/\", \"Content-Length\": \"1040\", \"Date\": \"Mon, 15 Oct 2018 10:48:01 GMT\"}}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\"}+3": "{\"headers\": {\"Content-Length\": \"469\", \"Vary\": \"Cookie\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowMiBHTVQifX0.DqYB4g.NvIYBZdgnQqn9Kwtqxum-6miRaQ; HttpOnly; Path=/\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Date\": \"Mon, 15 Oct 2018 10:48:02 GMT\"}, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d/download\\\", \\n \\\"filename\\\": \\\"1-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": true, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\", \\n \\\"uuid\\\": \\\"1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\"\\n}\\n\", \"status\": 200}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/rofl-missing/submissions\"}+2": "{\"body\": \"{\\n \\\"error\\\": \\\"Not Found\\\", \\n \\\"message\\\": \\\"The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.\\\"\\n}\\n\", \"status\": 404, \"version\": \"0.1.1\", \"headers\": {\"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Date\": \"Mon, 15 Oct 2018 10:48:06 GMT\", \"Content-Length\": \"166\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowNiBHTVQifX0.DqYB5g.btHtkB969m2bV8nZJS_h8VGkiTk; HttpOnly; Path=/\", \"Content-Type\": \"application/json\"}}"} \ No newline at end of file diff --git a/data/test_reply_source.json b/data/test_reply_source.json new file mode 100644 index 0000000..305d664 --- /dev/null +++ b/data/test_reply_source.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"headers\": {\"Content-Length\": \"5240\", \"Date\": \"Mon, 15 Oct 2018 10:46:58 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OCBHTVQifX0.DqYBog.fYCzbmIRuA6u65naeoL3F6rUSoc; HttpOnly; Path=/\"}, \"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7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DgCP5F2FwlC231aA2zrQBzU5kZt\\\\nUwElnIDI1WnZTXBz9y3FBpblohqr33XVsHZKl0yMbrT5JJPCZe30kZMz91p+mKZM\\\\nRV0C2gSKpylsUeGocaS5p0kf5QMTwDOlZoHJDRqYJVr0Uvcu8JMBFrNHVOU1iCPY\\\\nOTohSpG0VPGoNL7gog7npbbscZ8gWZiqykpGdyyL6N1I7JX0M49clt9RZHLbsMzA\\\\niOsEUF36WiPBzrchgwWPs+TEIQSQ2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"datable syncopation\\\", \\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bC8pRwXMYw//\\\\nfHo/CLGbpyaUGDh6jCU6ZtstCuWwjiyG4gawCS/f5WTShmcamGDN0L3QVzFK10cq\\\\nDpnJ1bb53bG9lqTdUapru6YEYV/F+snRGxUXAqBPFo7zr3qyiJL+UmftNKZiQN26\\\\nb8bvf4vvhHOMlj4Z46wxuBBZlDfJSa+geXeObxLOkhnwpFCBxIf6qErIliwCcIGj\\\\ntrHSJcChPthaKzfE2iZaQyIWaVQ4i5N9aJ61yhFyz/zBulCVBhr++5QVki8rav0+\\\\nrzxDQADly6vWPctiHh4giMfeZq1yOXfV5D62w6WhM0hmpQwikuxu9CkSEmcKbtjS\\\\nh/2BgfZGUMwyX90cJfFgKSB7mWYyxiMQLLehtVH7utMY8tmvBHQCMmwmm06XLLYa\\\\nuRDnh/NKIfGsYaAdoH5DoQohZeEpOk8jj047zZ4yJYLQFSF1Couo/wSYp2gzGQR1\\\\nb4ZtplZorLWHN3YeQqx8UkR1+Cy6DKUUFWCku4HnSLoMQldnrgEhySz1e2r5P7gl\\\\nKnta++yC3j82AFonKYzagauLGjuGWb126pC4+iMaQIRq/QH5C5FE8s3g99sv7oIe\\\\nySMOLY+rZwsTyTxHw6knPNErEd80QUpH1vUt1x3SjnW+l9Lvqll5I7dU6WuM1Ufs\\\\n3QgpNC6OHYMzlW9adGmyVBCW2erWALJnpJBaA+R4+8Y=\\\\n=5bhM\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:37.601298Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\"\\n }\\n ]\\n}\\n\", \"status\": 200, \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\"}+2": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWpR1\\\\nimtSJ0fMEMg9JmlXvvznZOsv9KT4zviD+slxuUBknLcqhhDOxf4uWI5xvCsnTlJq\\\\ngVw9qtvQQH+6Dly/XuBvUIWbeCzmWrnG/fIk2APsCrl0t3bQgv6Iw4a1pUwILByF\\\\nQSeS1xSiCzzM8ADLuiWzj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9RZHLbsMzA\\\\niOsEUF36WiPBzrchgwWPs+TEIQSQ2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n}\\n\", \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OSBHTVQifX0.DqYBow.94-bnoWUIk3LjjHM9jBQJ7z6eFg; HttpOnly; Path=/\", \"Date\": \"Mon, 15 Oct 2018 10:46:59 GMT\", \"Vary\": \"Cookie\", \"Content-Length\": \"2531\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\"}}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\"}+2": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"submissions\\\": [\\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d/download\\\", \\n \\\"filename\\\": \\\"1-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": true, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\", \\n \\\"uuid\\\": \\\"1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/98a79db7-2f34-4d08-ae00-6b4ab8a31b1b/download\\\", \\n \\\"filename\\\": \\\"2-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/98a79db7-2f34-4d08-ae00-6b4ab8a31b1b\\\", \\n \\\"uuid\\\": \\\"98a79db7-2f34-4d08-ae00-6b4ab8a31b1b\\\"\\n }\\n ]\\n}\\n\", \"headers\": {\"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowMSBHTVQifX0.DqYB4Q.gZRj3stxg_oPAqFYMJhffTcu8hM; HttpOnly; Path=/\", \"Content-Length\": \"1040\", \"Date\": \"Mon, 15 Oct 2018 10:48:01 GMT\"}}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\"}+3": "{\"headers\": {\"Content-Length\": \"469\", \"Vary\": \"Cookie\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowMiBHTVQifX0.DqYB4g.NvIYBZdgnQqn9Kwtqxum-6miRaQ; HttpOnly; Path=/\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Date\": \"Mon, 15 Oct 2018 10:48:02 GMT\"}, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d/download\\\", \\n \\\"filename\\\": \\\"1-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": true, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\", \\n \\\"uuid\\\": \\\"1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\"\\n}\\n\", \"status\": 200}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/rofl-missing/submissions\"}+2": "{\"body\": \"{\\n \\\"error\\\": \\\"Not Found\\\", \\n \\\"message\\\": \\\"The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.\\\"\\n}\\n\", \"status\": 404, \"version\": \"0.1.1\", \"headers\": {\"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Date\": \"Mon, 15 Oct 2018 10:48:06 GMT\", \"Content-Length\": \"166\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowNiBHTVQifX0.DqYB5g.btHtkB969m2bV8nZJS_h8VGkiTk; HttpOnly; Path=/\", \"Content-Type\": \"application/json\"}}", "{\"body\": \"{\\\"reply\\\": \\\"-----BEGIN PGP MESSAGE-----\\\\n\\\\nhQIMA/uCql0ybaddAQ//dg2iojyiyXBaUzKbPaL9+FlEEvraxXO+BbhcsbEdLI5E\\\\nKYxP5xb1LEOdaJjUcQaPjSARPnFbLzq3vsafZCBrEHtMWnSWxEpxbI1/DO+/Wbk1\\\\nT+ZVltaAdOIulfuMlIlL4rVCbprg+QUQbsbtIIOFdXpvuS1kQdv+F/sfYsFQanQw\\\\nV6u/yz3hgyymUyoBfZOXUfpFQ/t759s3rt3OGvwTzOx6o8Q3X+cKypwYsGsHzAUr\\\\n/N2Ggy6hYVzDj1czjtgUF2EWyKKfTN2RO9y+E0PYnu7C6QN41dx4yPsXFq16kOWC\\\\nLDyeXW2A/3/fGqp9176V4DRHMkUB6WkkXnekJBiyar1rG7WJ09KNdXGKJw6tjlqT\\\\nz4mnjgkZopSbuwJJgs+RZFddpGU31PSQg3ODWZRmSQbL/7lFtsJCY0yFjGoEdJFw\\\\npg5nJ6uOQN6bWPdM47nEPweFgNBIPmQccm0ayewaxvpIgTH+okBlLMPxnDg51vaA\\\\nF7dzZP4SdNQuBkHKq3DW7tu21+haa5YcjY5vJry9o5Fu9qJJadiI8Cg0JJqTVsUs\\\\n7Vu4eK1F9popI5hzdRBvBIdNB4LlIJiYmMKxD7l5yyOXSdoyINPU04PwxM3yO6QH\\\\n5Uw7gVNYCvgKSHAvfFnYAjPSd1m7CPW/aI2EjIHMBf+8FEyyWdHduPCMHZhUZ5XS\\\\nVAFdU++LS7PKxIFsXKtkHSMmO+GRfI/+SrVmGfw1YJbSmhaRAPk5ChqS7RQMgz/j\\\\nt+mAINV0vHUNAJkMW/QZXgdVw+eca0ITs/1u3fKsBlmQNv4Efg==\\\\n=686S\\\\n-----END PGP MESSAGE-----\\\\n\\\\n\\\"}\", \"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"POST\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\"}+2": "{\"status\": 201, \"body\": \"{\\n \\\"message\\\": \\\"Your reply has been stored\\\"\\n}\\n\", \"version\": \"0.1.1\", \"headers\": {\"Content-Length\": \"46\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Date\": \"Mon, 15 Oct 2018 10:48:08 GMT\", \"Vary\": \"Cookie\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowOCBHTVQifX0.DqYB6A.atUC9gjGCTAEbe8mPEAQcsCDWvU; HttpOnly; Path=/\"}}"} \ No newline at end of file diff --git a/data/test_star_add_remove.json b/data/test_star_add_remove.json new file mode 100644 index 0000000..e83c9ca --- /dev/null +++ b/data/test_star_add_remove.json @@ -0,0 +1 @@ +{"{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+1": "{\"headers\": {\"Content-Length\": \"5240\", \"Date\": \"Mon, 15 Oct 2018 10:46:58 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OCBHTVQifX0.DqYBog.fYCzbmIRuA6u65naeoL3F6rUSoc; HttpOnly; Path=/\"}, \"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWpR1\\\\nimtSJ0fMEMg9JmlXvvznZOsv9KT4zviD+slxuUBknLcqhhDOxf4uWI5xvCsnTlJq\\\\ngVw9qtvQQH+6Dly/XuBvUIWbeCzmWrnG/fIk2APsCrl0t3bQgv6Iw4a1pUwILByF\\\\nQSeS1xSiCzzM8ADLuiWzjFaAQgQgA7KkFi+D7Cg3EPur1pLC60BhwXDrlJQ/yyzb\\\\n4D9iRZOdrUxrEtUCtyLimFuCixsT2XcD1TYdcM4mB1h6yUpEzyfIEgQ+OW5Ec4NO\\\\nErJ7U6X+2kpH/E6u5szD2ZSVuQPBjY2riDpzJkAC1C7s0dU9JK8ini+Wce2EQt7+\\\\nBltumD5vEsZGcpTaKT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\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"datable syncopation\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbp8BEADLk6fQ9ZYVCV1nzEB62akW3uK3ry/fVx37XHjJkP1ouqZOS4+X\\\\nyLy/TsHZEiP+NnWTAsMlkVlYxnO6KfsaEe/HMEXHddMV0B2Z5VMqmyPjotPXc/k3\\\\nzPe5HToQl917pPCbZE3uuHhJodqKwaieFhj2DoLouP8PAGDsJVu/9fxfEYHrPQgD\\\\ncwDVtj3gzM6iulIGgDVIIIAqI8CJl9qJTrqTVu34rBKwctSd+IEhWzmCZD02xt7a\\\\nTain0KHle+WACz0rdRf4uhkczufh9Q7TzSq1h0omZDZQq5CKVJQZg12Rka8hMs1w\\\\ney3/ZpQQMOnYAoWAj7Dhf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KIfGsYaAdoH5DoQohZeEpOk8jj047zZ4yJYLQFSF1Couo/wSYp2gzGQR1\\\\nb4ZtplZorLWHN3YeQqx8UkR1+Cy6DKUUFWCku4HnSLoMQldnrgEhySz1e2r5P7gl\\\\nKnta++yC3j82AFonKYzagauLGjuGWb126pC4+iMaQIRq/QH5C5FE8s3g99sv7oIe\\\\nySMOLY+rZwsTyTxHw6knPNErEd80QUpH1vUt1x3SjnW+l9Lvqll5I7dU6WuM1Ufs\\\\n3QgpNC6OHYMzlW9adGmyVBCW2erWALJnpJBaA+R4+8Y=\\\\n=5bhM\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:37.601298Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\"\\n }\\n ]\\n}\\n\", \"status\": 200, \"version\": \"0.1.1\"}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\"}+2": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWpR1\\\\nimtSJ0fMEMg9JmlXvvznZOsv9KT4zviD+slxuUBknLcqhhDOxf4uWI5xvCsnTlJq\\\\ngVw9qtvQQH+6Dly/XuBvUIWbeCzmWrnG/fIk2APsCrl0t3bQgv6Iw4a1pUwILByF\\\\nQSeS1xSiCzzM8ADLuiWzjFaAQgQgA7KkFi+D7Cg3EPur1pLC60BhwXDrlJQ/yyzb\\\\n4D9iRZOdrUxrEtUCtyLimFuCixsT2XcD1TYdcM4mB1h6yUpEzyfIEgQ+OW5Ec4NO\\\\nErJ7U6X+2kpH/E6u5szD2ZSVuQPBjY2riDpzJkAC1C7s0dU9JK8ini+Wce2EQt7+\\\\nBltumD5vEsZGcpTaKTLsQ9RWvtvg0A5Viv7q+/eLyvMFRzNF1Tp3EsI84QARAQAB\\\\ntHxBdXRvZ2VuZXJhdGVkIEtleSA8UDNIWTRTMkhPQkVGR1M0R0JTTExURkNNTFFL\\\\nU0lMR1g2NVlDRk42NlFVWVdSS1RIUFJOV1hWRjNFUU9XSkFFRFJZQlQ3QVlLQ1VX\\\\nWU1aSVFES0FHWVZZUEZMSU1NSlhOVFROUU9NQT0+iQI/BBMBCgApBQJbxG6cAhsv\\\\nBQkB4UYkBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQ7lj3fkt9c+iMDRAA\\\\njjLrabgn2e2012+n5eIUus6cdHFQDM5R4TO6O6i6h7nvBGIA61j6tkKirG+8a/kT\\\\neCYdXu/nAgNbglkF0Gsg36KvipkQ7N003Cp9r0rofbA2ERSmT/SkCiMCDECGidx+\\\\n3YnCvEj5Xq+mqooKeyA3sRJe/TS/p0/RoY6hbXZhjcjnKfZL8030rL/wahQSdRXi\\\\nsEo2DdWum0E4ptqDZOv1E9Ek1xTL6sJ4hs83N1LI2TX5wcS58+y7di0KDTlxCFRn\\\\nd6Z5YQZWbssoHCMJt8J9kLg9vWfJSCERpuD/RDgCP5F2FwlC231aA2zrQBzU5kZt\\\\nUwElnIDI1WnZTXBz9y3FBpblohqr33XVsHZKl0yMbrT5JJPCZe30kZMz91p+mKZM\\\\nRV0C2gSKpylsUeGocaS5p0kf5QMTwDOlZoHJDRqYJVr0Uvcu8JMBFrNHVOU1iCPY\\\\nOTohSpG0VPGoNL7gog7npbbscZ8gWZiqykpGdyyL6N1I7JX0M49clt9RZHLbsMzA\\\\niOsEUF36WiPBzrchgwWPs+TEIQSQ2HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n}\\n\", \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0Njo1OSBHTVQifX0.DqYBow.94-bnoWUIk3LjjHM9jBQJ7z6eFg; HttpOnly; Path=/\", \"Date\": \"Mon, 15 Oct 2018 10:46:59 GMT\", \"Vary\": \"Cookie\", \"Content-Length\": \"2531\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\"}}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\"}+2": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"submissions\\\": [\\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d/download\\\", \\n \\\"filename\\\": \\\"1-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": true, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\", \\n \\\"uuid\\\": \\\"1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\"\\n }, \\n {\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/98a79db7-2f34-4d08-ae00-6b4ab8a31b1b/download\\\", \\n \\\"filename\\\": \\\"2-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": false, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/98a79db7-2f34-4d08-ae00-6b4ab8a31b1b\\\", \\n \\\"uuid\\\": \\\"98a79db7-2f34-4d08-ae00-6b4ab8a31b1b\\\"\\n }\\n ]\\n}\\n\", \"headers\": {\"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowMSBHTVQifX0.DqYB4Q.gZRj3stxg_oPAqFYMJhffTcu8hM; HttpOnly; Path=/\", \"Content-Length\": \"1040\", \"Date\": \"Mon, 15 Oct 2018 10:48:01 GMT\"}}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\"}+3": "{\"headers\": {\"Content-Length\": \"469\", \"Vary\": \"Cookie\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowMiBHTVQifX0.DqYB4g.NvIYBZdgnQqn9Kwtqxum-6miRaQ; HttpOnly; Path=/\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Date\": \"Mon, 15 Oct 2018 10:48:02 GMT\"}, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"download_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d/download\\\", \\n \\\"filename\\\": \\\"1-starry-eyed_shaping-msg.gpg\\\", \\n \\\"is_read\\\": true, \\n \\\"size\\\": 604, \\n \\\"source_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"submission_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions/1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\", \\n \\\"uuid\\\": \\\"1961c82d-466f-40c6-a7f6-7251f3dfbb7d\\\"\\n}\\n\", \"status\": 200}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources/rofl-missing/submissions\"}+2": "{\"body\": \"{\\n \\\"error\\\": \\\"Not Found\\\", \\n \\\"message\\\": \\\"The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.\\\"\\n}\\n\", \"status\": 404, \"version\": \"0.1.1\", \"headers\": {\"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Vary\": \"Cookie\", \"Date\": \"Mon, 15 Oct 2018 10:48:06 GMT\", \"Content-Length\": \"166\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowNiBHTVQifX0.DqYB5g.btHtkB969m2bV8nZJS_h8VGkiTk; HttpOnly; Path=/\", \"Content-Type\": \"application/json\"}}", "{\"body\": \"{\\\"reply\\\": \\\"-----BEGIN PGP MESSAGE-----\\\\n\\\\nhQIMA/uCql0ybaddAQ//dg2iojyiyXBaUzKbPaL9+FlEEvraxXO+BbhcsbEdLI5E\\\\nKYxP5xb1LEOdaJjUcQaPjSARPnFbLzq3vsafZCBrEHtMWnSWxEpxbI1/DO+/Wbk1\\\\nT+ZVltaAdOIulfuMlIlL4rVCbprg+QUQbsbtIIOFdXpvuS1kQdv+F/sfYsFQanQw\\\\nV6u/yz3hgyymUyoBfZOXUfpFQ/t759s3rt3OGvwTzOx6o8Q3X+cKypwYsGsHzAUr\\\\n/N2Ggy6hYVzDj1czjtgUF2EWyKKfTN2RO9y+E0PYnu7C6QN41dx4yPsXFq16kOWC\\\\nLDyeXW2A/3/fGqp9176V4DRHMkUB6WkkXnekJBiyar1rG7WJ09KNdXGKJw6tjlqT\\\\nz4mnjgkZopSbuwJJgs+RZFddpGU31PSQg3ODWZRmSQbL/7lFtsJCY0yFjGoEdJFw\\\\npg5nJ6uOQN6bWPdM47nEPweFgNBIPmQccm0ayewaxvpIgTH+okBlLMPxnDg51vaA\\\\nF7dzZP4SdNQuBkHKq3DW7tu21+haa5YcjY5vJry9o5Fu9qJJadiI8Cg0JJqTVsUs\\\\n7Vu4eK1F9popI5hzdRBvBIdNB4LlIJiYmMKxD7l5yyOXSdoyINPU04PwxM3yO6QH\\\\n5Uw7gVNYCvgKSHAvfFnYAjPSd1m7CPW/aI2EjIHMBf+8FEyyWdHduPCMHZhUZ5XS\\\\nVAFdU++LS7PKxIFsXKtkHSMmO+GRfI/+SrVmGfw1YJbSmhaRAPk5ChqS7RQMgz/j\\\\nt+mAINV0vHUNAJkMW/QZXgdVw+eca0ITs/1u3fKsBlmQNv4Efg==\\\\n=686S\\\\n-----END PGP MESSAGE-----\\\\n\\\\n\\\"}\", \"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"POST\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\"}+2": "{\"status\": 201, \"body\": \"{\\n \\\"message\\\": \\\"Your reply has been stored\\\"\\n}\\n\", \"version\": \"0.1.1\", \"headers\": {\"Content-Length\": \"46\", \"Content-Type\": \"application/json\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Date\": \"Mon, 15 Oct 2018 10:48:08 GMT\", \"Vary\": \"Cookie\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowOCBHTVQifX0.DqYB6A.atUC9gjGCTAEbe8mPEAQcsCDWvU; HttpOnly; Path=/\"}}", "{\"body\": null, \"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"POST\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\"}+2": "{\"body\": \"{\\n \\\"message\\\": \\\"Star added\\\"\\n}\\n\", \"status\": 201, \"version\": \"0.1.1\", \"headers\": {\"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODowOSBHTVQifX0.DqYB6Q.0UMdHuVZ4MNd4q0uPqO5wh47YRs; HttpOnly; Path=/\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Date\": \"Mon, 15 Oct 2018 10:48:09 GMT\", \"Vary\": \"Cookie\", \"Content-Type\": \"application/json\", \"Content-Length\": \"30\"}}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"DELETE\", \"path_query\": \"api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\"}+3": "{\"headers\": {\"Content-Type\": \"application/json\", \"Content-Length\": \"32\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODoxMCBHTVQifX0.DqYB6g.GJUBWnr-jXRbJWsmFA5Ww-oMXXg; HttpOnly; Path=/\", \"Vary\": \"Cookie\", \"Date\": \"Mon, 15 Oct 2018 10:48:10 GMT\", \"Server\": \"Werkzeug/0.14.1 Python/2.7.6\"}, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"message\\\": \\\"Star removed\\\"\\n}\\n\", \"status\": 200}", "{\"headers\": \"{\\\"Accept\\\": \\\"application/json\\\", \\\"Content-Type\\\": \\\"application/json\\\"}\", \"method\": \"GET\", \"path_query\": \"api/v1/sources\"}+4": "{\"status\": 200, \"version\": \"0.1.1\", \"body\": \"{\\n \\\"sources\\\": [\\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/add_star\\\", \\n \\\"interaction_count\\\": 5, \\n \\\"is_flagged\\\": true, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"starry-eyed shaping\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbpwBEADBnicdUU5S1cy/omybzgInOXu3TaAcw3eIuvPVZMrgSqDOsW3w\\\\nXzu/zwZ4npnXT9mDkR7wGDVzMlbfPST393/53OeFVTwQWBhdeoWSA+XGAA4HQWKt\\\\nfe2oCJCyA/5p3384iTSjWOYvCkjVZNHFLwlf4MwJ1gYpjx70sP+p+sofzwbOLjD0\\\\nVk0ipa6F73DA8nuCpNKz422BhMy+b8/T7xrKRtuiH58ibdFYE5cIsFg905ohP+Aq\\\\nCu2R2hqIA7dEPJ4Ij8AMh6UsAg00H6i6bB9phOwqGMw5An+akK+z6iYKghsnWpR1\\\\nimtSJ0fMEMg9JmlXvvznZOsv9KT4zviD+slxuUBknLcqhhDOxf4uWI5xvCsnTlJq\\\\ngVw9qtvQQH+6Dly/XuBvUIWbeCzmWrnG/fIk2APsCrl0t3bQgv6Iw4a1pUwILByF\\\\nQSeS1xSiCzzM8ADLuiWzjFaAQgQgA7KkFi+D7Cg3EPur1pLC60BhwXDrlJQ/yyz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HU8MXWybEDdExmYbZZTMj6tk/wCn7RbvK2f\\\\nOYO13pLTM4fuQIPn8CYyRtvoXMeJCxQiHn/qy6rRcdLDPwRac4p/lFKI8SRVxoUs\\\\nrmKFON9P6wN3ooXv9kG5rc8ewLxYrkgidzrD/GOVpcM=\\\\n=MPWa\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:29.248380Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\", \\n \\\"uuid\\\": \\\"5f891a3a-0b2a-40b7-9c9a-49c4ca7252b2\\\"\\n }, \\n {\\n \\\"add_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/add_star\\\", \\n \\\"interaction_count\\\": 4, \\n \\\"is_flagged\\\": false, \\n \\\"is_starred\\\": false, \\n \\\"journalist_designation\\\": \\\"datable syncopation\\\", \\n \\\"key\\\": {\\n \\\"public\\\": \\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\n\\\\nmQINBFvEbp8BEADLk6fQ9ZYVCV1nzEB62akW3uK3ry/fVx37XHjJkP1ouqZOS4+X\\\\nyLy/TsHZEiP+NnWTAsMlkVlYxnO6KfsaEe/HMEXHddMV0B2Z5VMqmyPjotPXc/k3\\\\nzPe5HToQl917pPCbZE3uuHhJodqKwaieFhj2DoLouP8PAGDsJVu/9fxfEYHr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zBulCVBhr++5QVki8rav0+\\\\nrzxDQADly6vWPctiHh4giMfeZq1yOXfV5D62w6WhM0hmpQwikuxu9CkSEmcKbtjS\\\\nh/2BgfZGUMwyX90cJfFgKSB7mWYyxiMQLLehtVH7utMY8tmvBHQCMmwmm06XLLYa\\\\nuRDnh/NKIfGsYaAdoH5DoQohZeEpOk8jj047zZ4yJYLQFSF1Couo/wSYp2gzGQR1\\\\nb4ZtplZorLWHN3YeQqx8UkR1+Cy6DKUUFWCku4HnSLoMQldnrgEhySz1e2r5P7gl\\\\nKnta++yC3j82AFonKYzagauLGjuGWb126pC4+iMaQIRq/QH5C5FE8s3g99sv7oIe\\\\nySMOLY+rZwsTyTxHw6knPNErEd80QUpH1vUt1x3SjnW+l9Lvqll5I7dU6WuM1Ufs\\\\n3QgpNC6OHYMzlW9adGmyVBCW2erWALJnpJBaA+R4+8Y=\\\\n=5bhM\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\\n\\\", \\n \\\"type\\\": \\\"PGP\\\"\\n }, \\n \\\"last_updated\\\": \\\"2018-10-15T10:40:37.601298Z\\\", \\n \\\"number_of_documents\\\": 0, \\n \\\"number_of_messages\\\": 2, \\n \\\"remove_star_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/remove_star\\\", \\n \\\"replies_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/replies\\\", \\n \\\"submissions_url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd/submissions\\\", \\n \\\"url\\\": \\\"/api/v1/sources/e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\", \\n \\\"uuid\\\": \\\"e94ad028-52d4-4b48-bd8a-61e886aac9dd\\\"\\n }\\n ]\\n}\\n\", \"headers\": {\"Server\": \"Werkzeug/0.14.1 Python/2.7.6\", \"Date\": \"Mon, 15 Oct 2018 10:48:11 GMT\", \"Content-Length\": \"5240\", \"Vary\": \"Cookie\", \"Set-Cookie\": \"js=eyJleHBpcmVzIjp7IiBkIjoiTW9uLCAxNSBPY3QgMjAxOCAxMjo0ODoxMSBHTVQifX0.DqYB6w.GxCan9EsD8IljXM3eXTm34vS_2c; HttpOnly; Path=/\", \"Content-Type\": \"application/json\"}}"} \ No newline at end of file diff --git a/sdclientapi/__init__.py b/sdclientapi/__init__.py index b020ad1..cd48afd 100644 --- a/sdclientapi/__init__.py +++ b/sdclientapi/__init__.py @@ -1,168 +1,41 @@ from pprint import pprint import os +import configparser import json import requests +from subprocess import PIPE, Popen from typing import Optional, Dict, List, Tuple +from .sdlocalobjects import * -class BaseError(Exception): - pass +proxyvmname = "sd-journalist" -class ReplyError(BaseError): - "For errors on reply messages" - def __init__(self, message): - self.msg = message - - def __str__(self): - return repr(self.msg) - - -class WrongUUIDError(BaseError): - "For missing UUID, can be for source or submission" - - def __init__(self, message): - self.msg = message - - def __str__(self): - return repr(self.msg) - - -class AuthError(BaseError): - "For Authentication errors" - - def __init__(self, message): - self.msg = message - - def __str__(self): - return repr(self.msg) - - -class AttributeError(BaseError): - def __init__(self, message): - self.msg = message - - def __str__(self): - return repr(self.msg) - - -class Reply: - """ - This class represents a reply to the source. - """ - - def __init__(self, **kwargs) -> None: - self.filename = "" # type: str - self.journalist_username = "" # type: str - self.journalist_uuid = "" # type: str - self.is_deleted_by_source = False # type: bool - self.reply_url = "" # type: str - self.size = 0 # type: int - self.source_url = "" # type: str - self.source_uuid = "" # type: str - self.uuid = "" # type: str - - for key in [ - "filename", - "journalist_username", - "journalist_uuid", - "is_deleted_by_source", - "reply_url", - "size", - "source_url", - "uuid", - ]: - if not key in kwargs: - AttributeError("Missing key {}".format(key)) - setattr(self, key, kwargs[key]) - - # Now let us set source uuid - values = self.source_url.split("/") - self.source_uuid = values[-1] - - -class Submission: - """ - This class represents a submission object in the server. - """ - - def __init__(self, **kwargs) -> None: - self.download_url = "" # type: str - self.filename = "" # type: str - self.is_read = False # type: bool - self.size = 0 # type: int - self.source_url = "" # type: str - self.source_uuid = "" # type: str - self.submission_url = "" # type: str - self.uuid = "" # type: str - - if ["uuid"] == list(kwargs.keys()): - # Means we are creating an object only for fetching from server. - self.uuid = kwargs["uuid"] - return - - for key in [ - "download_url", - "filename", - "is_read", - "size", - "source_url", - "submission_url", - "uuid", - ]: - if not key in kwargs: - AttributeError("Missing key {}".format(key)) - setattr(self, key, kwargs[key]) - _, self.source_uuid = self.source_url.rsplit('/', 1) - - -class Source: +def json_query(data): """ - This class represents a source object in the server. + Takes a json based query and passes to the network proxy. + Returns the JSON output from the proxy. """ - - def __init__(self, **kwargs): - self.add_star_url = "" # type: str - self.interaction_count = 0 # type: int - self.is_flagged = False # type: bool - self.is_starred = False # type: bool - self.journalist_designation = "" # type: str - self.key = {} # type: Dict - self.last_updated = "" # type: str - self.number_of_documents = 0 # type: int - self.number_of_messages = 0 # type: int - self.remove_star_url = "" # type: str - self.replies_url = "" # type: str - self.submissions_url = "" # type: str - self.url = "" # type: str - self.uuid = "" # type: str - - if ["uuid"] == list(kwargs.keys()): - # Means we are creating an object only for fetching from server. - self.uuid = kwargs["uuid"] - return - - for key in [ - "add_star_url", - "interaction_count", - "is_flagged", - "is_starred", - "journalist_designation", - "key", - "last_updated", - "number_of_documents", - "number_of_messages", - "remove_star_url", - "replies_url", - "submissions_url", - "url", - "uuid", - ]: - if not key in kwargs: - AttributeError("Missing key {}".format(key)) - setattr(self, key, kwargs[key]) + global proxyvmname + config = configparser.ConfigParser() + try: + if os.path.exists("/etc/sd-sdk.conf"): + config.read("/etc/sd-sdk.conf") + proxyvmname = config["proxy"]["name"] + except: + pass # We already have a default name + + p = Popen( + ["/usr/lib/qubes/qrexec-client-vm", proxyvmname, "securedrop.Proxy"], + stdin=PIPE, + stdout=PIPE, + ) + p.stdin.write(data.encode("utf-8")) + d = p.communicate() + output = d[0].decode("utf-8") + return output.strip() class API: @@ -176,7 +49,7 @@ class API: :returns: An object of API class. """ - def __init__(self, address, username, passphrase, totp) -> None: + def __init__(self, address, username, passphrase, totp, proxy=False) -> None: """ Primary API class, this is the only thing which will make network call. """ @@ -187,22 +60,56 @@ def __init__(self, address, username, passphrase, totp) -> None: self.totp = totp # type: str self.token = {"token": "", "expiration": ""} self.auth_header = {"Authorization": ""} # type: Dict - - def authenticate(self) -> bool: + self.proxy = proxy # type: bool + + def _send_json_request(self, method, path_query, body=None, headers=None): + if self.proxy: # We are using the Qubes securedrop-proxy + if method == "POST": + data = {"method": method, "path_query": path_query, "body": body} + if headers: + data["headers"] = headers + elif method == "GET" or method == "DELETE": + data = {"method": method, "path_query": path_query, "headers": headers} + + data_str = json.dumps(data, sort_keys=True) + result = json.loads(json_query(data_str)) + return json.loads(result["body"]), result["status"], result["headers"] + + else: # We are not using the Qubes securedrop-proxy + if method == "POST": + result = requests.post(self.server + path_query, data=body) + elif method == "GET": + result = requests.get(self.server + path_query, headers=headers) + elif method == "DELETE": + result = requests.delete(self.server + path_query, headers=headers) + + # Because when we download a file there is no JSON in the body + if path_query.find("/download") != -1: + return result, result.status_code, result.headers + return result.json(), result.status_code, result.headers + + def authenticate(self, totp="") -> bool: """ Authenticate the user and fetches the token from the server. :returns: True if authentication is successful, raise AuthError otherwise. """ + if not totp: + totp = self.totp user_data = { "username": self.username, "passphrase": self.passphrase, - "one_time_code": self.totp, + "one_time_code": totp, } - token = requests.post(self.server + "api/v1/token", data=json.dumps(user_data)) + method = "POST" + path_query = "api/v1/token" + body = json.dumps(user_data) + try: - token_data = token.json() + token_data, status_code, headers = self._send_json_request( + method, path_query, body=body + ) except json.decoder.JSONDecodeError: raise BaseError("Error in parsing JSON") if not "expiration" in token_data: @@ -225,11 +132,13 @@ def get_sources(self) -> List[Source]: :returns: List of Source objects. """ - url = self.server + "api/v1/sources" + path_query = "api/v1/sources" + method = "GET" try: - res = requests.get(url, headers=self.auth_header) - data = res.json() + data, status_code, headers = self._send_json_request( + method, path_query, headers=self.auth_header + ) except json.decoder.JSONDecodeError: raise BaseError("Error in parsing JSON") @@ -252,15 +161,17 @@ def get_source(self, source: Source) -> Source: :param source: Source object containing only source's uuid value. :returns: Source object fetched from server for the given UUID value. """ - url = self.server + "api/v1/sources/{}".format(source.uuid) + path_query = "api/v1/sources/{}".format(source.uuid) + method = "GET" try: - res = requests.get(url, headers=self.auth_header) + data, status_code, headers = self._send_json_request( + method, path_query, headers=self.auth_header + ) - if res.status_code == 404: + if status_code == 404: raise WrongUUIDError("Missing source {}".format(source.uuid)) - data = res.json() except json.decoder.JSONDecodeError: raise BaseError("Error in parsing JSON") @@ -288,15 +199,17 @@ def delete_source(self, source: Source) -> bool: :param source: Source object containing only source's uuid value. :returns: True if successful, raises Errors in case of wrong values. """ - url = self.server + "api/v1/sources/{}".format(source.uuid) + path_query = "api/v1/sources/{}".format(source.uuid) + method = "DELETE" try: - res = requests.delete(url, headers=self.auth_header) + data, status_code, headers = self._send_json_request( + method, path_query, headers=self.auth_header + ) - if res.status_code == 404: + if status_code == 404: raise WrongUUIDError("Missing source {}".format(source.uuid)) - data = res.json() except json.decoder.JSONDecodeError: raise BaseError("Error in parsing JSON") @@ -328,11 +241,15 @@ def add_star(self, source: Source) -> bool: :param source: The source object to whom we want add a star. :returns: True if successful, raises Error otherwise. """ - url = self.server.rstrip("/") + source.add_star_url + path_query = "api/v1/sources/{}/add_star".format(source.uuid) + method = "POST" try: - res = requests.post(url, headers=self.auth_header) - data = res.json() + data, status_code, headers = self._send_json_request( + method, path_query, headers=self.auth_header + ) + if status_code == 404: + raise WrongUUIDError("Missing source {}".format(source.uuid)) except json.decoder.JSONDecodeError: raise BaseError("Error in parsing JSON") @@ -347,11 +264,15 @@ def remove_star(self, source: Source) -> bool: :param source: Source object to remove the star from. :returns: True if successful, raises Error otherwise. """ - url = self.server.rstrip("/") + source.remove_star_url + path_query = "api/v1/sources/{}/remove_star".format(source.uuid) + method = "DELETE" try: - res = requests.delete(url, headers=self.auth_header) - data = res.json() + data, status_code, headers = self._send_json_request( + method, path_query, headers=self.auth_header + ) + if status_code == 404: + raise WrongUUIDError("Missing source {}".format(source.uuid)) except json.decoder.JSONDecodeError: raise BaseError("Error in parsing JSON") @@ -367,15 +288,17 @@ def get_submissions(self, source: Source) -> List[Submission]: :param source: Source object for whom we want to find all the submissions. :returns: List of Submission objects. """ - url = self.server.rstrip("/") + source.submissions_url + path_query = "api/v1/sources/{}/submissions".format(source.uuid) + method = "GET" try: - res = requests.get(url, headers=self.auth_header) + data, status_code, headers = self._send_json_request( + method, path_query, headers=self.auth_header + ) - if res.status_code == 404: + if status_code == 404: raise WrongUUIDError("Missing submission {}".format(source.uuid)) - data = res.json() except json.decoder.JSONDecodeError: raise BaseError("Error in parsing JSON") @@ -398,18 +321,19 @@ def get_submission(self, submission: Submission) -> Submission: :param submission: Submission object we want to update. :returns: Updated submission object from the server. """ - source_uuid = submission.source_url.split("/")[-1] - url = self.server.rstrip("/") + "/api/v1/sources/{}/submissions/{}".format( - source_uuid, submission.uuid + path_query = "api/v1/sources/{}/submissions/{}".format( + submission.source_uuid, submission.uuid ) + method = "GET" try: - res = requests.get(url, headers=self.auth_header) + data, status_code, headers = self._send_json_request( + method, path_query, headers=self.auth_header + ) - if res.status_code == 404: + if status_code == 404: raise WrongUUIDError("Missing submission {}".format(submission.uuid)) - data = res.json() except json.decoder.JSONDecodeError: raise BaseError("Error in parsing JSON") @@ -427,7 +351,7 @@ def get_submission_from_string(self, uuid: str, source_uuid: str) -> Submission: :returns: Updated submission object from the server. """ s = Submission(uuid=uuid) - s.source_url = "/api/v1/sources/{}".format(source_uuid) + s.source_uuid = source_uuid return self.get_submission(s) def get_all_submissions(self) -> List[Submission]: @@ -436,11 +360,13 @@ def get_all_submissions(self) -> List[Submission]: :returns: List of Submission objects. """ - url = self.server.rstrip("/") + "/api/v1/submissions" + path_query = "api/v1/submissions" + method = "GET" try: - res = requests.get(url, headers=self.auth_header) - data = res.json() + data, status_code, headers = self._send_json_request( + method, path_query, headers=self.auth_header + ) except json.decoder.JSONDecodeError: raise BaseError("Error in parsing JSON") @@ -466,18 +392,19 @@ def delete_submission(self, submission: Submission) -> bool: # Not using direct URL because this helps to use the same method # from local submission (not fetched from server) objects. # See the *from_string for an example. - source_uuid = submission.source_url.split("/")[-1] - url = self.server.rstrip("/") + "/api/v1/sources/{}/submissions/{}".format( - source_uuid, submission.uuid + path_query = "api/v1/sources/{}/submissions/{}".format( + submission.source_uuid, submission.uuid ) + method = "DELETE" try: - res = requests.delete(url, headers=self.auth_header) + data, status_code, headers = self._send_json_request( + method, path_query, headers=self.auth_header + ) - if res.status_code == 404: + if status_code == 404: raise WrongUUIDError("Missing submission {}".format(submission.uuid)) - data = res.json() except json.decoder.JSONDecodeError: raise BaseError("Error in parsing JSON") @@ -501,7 +428,9 @@ def delete_submission_from_string(self, uuid: str, source_uuid: str) -> bool: s.source_url = "/api/v1/sources/{}".format(source_uuid) return self.delete_submission(s) - def download_submission(self, submission: Submission, path: str) -> Tuple[str, str]: + def download_submission( + self, submission: Submission, path: str = "" + ) -> Tuple[str, str]: """ Returns a tuple of sha256sum and file path for a given Submission object. This method also requires a directory path in where it will save the submission file. @@ -511,34 +440,45 @@ def download_submission(self, submission: Submission, path: str) -> Tuple[str, s :returns: Tuple of sha256sum and path of the saved submission. """ - url = self.server.rstrip("/") + submission.download_url + path_query = "api/v1/sources/{}/submissions/{}/download".format( + submission.source_uuid, submission.uuid + ) + method = "GET" - if os.path.exists(path) and not os.path.isdir(path): - raise BaseError("Please provide a vaild directory to save.") + if path: + if os.path.exists(path) and not os.path.isdir(path): + raise BaseError("Please provide a vaild directory to save.") try: - res = requests.get(url, headers=self.auth_header, stream=True) + data, status_code, headers = self._send_json_request( + method, path_query, headers=self.auth_header + ) - if res.status_code == 404: - raise WrongUUIDError("Missing submission {}".format(submission.uuid)) + if status_code == 404: + raise WrongUUIDError("Missing reply {}".format(submission.uuid)) # Get the headers - headers = res.headers - etag = headers["Etag"] - - # This is where we will save our downloaded file - filepath = os.path.join(path, submission.filename) - with open(filepath, "wb") as fobj: - for chunk in res.iter_content( - chunk_size=1024 - ): # Getting 1024 in each chunk - if chunk: - fobj.write(chunk) - - # Because etag comes as JSON encoded string - etag = json.loads(etag) + headers = headers + + if not self.proxy: + # This is where we will save our downloaded file + filepath = os.path.join(path, submission.filename) + with open(filepath, "wb") as fobj: + for chunk in data.iter_content( + chunk_size=1024 + ): # Getting 1024 in each chunk + if chunk: + fobj.write(chunk) + + else: + filepath = os.path.join( + "/home/user/QubesIncoming/", proxyvmname, data["filename"] + ) # Return the tuple of sha256sum, filepath - return etag[7:], filepath + # Returning empty string instead of sha256sum due to this + # SecureDrop server bug: + # https://github.com/freedomofpress/securedrop/issues/3877 + return "", filepath except Exception as err: raise BaseError(err) @@ -549,11 +489,17 @@ def flag_source(self, source: Source) -> bool: :param source: Source object we want to flag. :returns: True if successful, raises Error otherwise. """ - url = self.server.rstrip("/") + "/api/v1/sources/{}/flag".format(source.uuid) + path_query = "api/v1/sources/{}/flag".format(source.uuid) + method = "POST" try: - res = requests.post(url, headers=self.auth_header) - data = res.json() + data, status_code, headers = self._send_json_request( + method, path_query, headers=self.auth_header + ) + + if status_code == 404: + raise WrongUUIDError("Missing source {}".format(source.uuid)) + except json.decoder.JSONDecodeError: raise BaseError("Error in parsing JSON") @@ -574,11 +520,14 @@ def get_current_user(self): 'username': 'journalist' } """ - url = self.server.rstrip("/") + "/api/v1/user" + path_query = "api/v1/user" + method = "GET" try: - res = requests.get(url, headers=self.auth_header) - data = res.json() + data, status_code, headers = self._send_json_request( + method, path_query, headers=self.auth_header + ) + except json.decoder.JSONDecodeError: raise BaseError("Error in parsing JSON") @@ -595,17 +544,18 @@ def reply_source(self, source: Source, msg: str) -> bool: :param source: Source object we want to reply. :param msg: Encrypted message with Source's GPG public key. """ - url = self.server.rstrip("/") + source.replies_url - + path_query = "api/v1/sources/{}/replies".format(source.uuid) + method = "POST" reply = {"reply": msg} try: - res = requests.post(url, headers=self.auth_header, data=json.dumps(reply)) + data, status_code, headers = self._send_json_request( + method, path_query, body=json.dumps(reply), headers=self.auth_header + ) - if res.status_code == 400: - raise ReplyError(res.json()["message"]) + if status_code == 400: + raise ReplyError(data["message"]) - data = res.json() except json.decoder.JSONDecodeError: raise BaseError("Error in parsing JSON") @@ -624,15 +574,17 @@ def get_replies_from_source(self, source: Source) -> List[Reply]: :param source: Source object containing only source's uuid value. :returns: List of Reply objects. """ - url = self.server + "api/v1/sources/{}/replies".format(source.uuid) + path_query = "api/v1/sources/{}/replies".format(source.uuid) + method = "GET" try: - res = requests.get(url, headers=self.auth_header) + data, status_code, headers = self._send_json_request( + method, path_query, headers=self.auth_header + ) - if res.status_code == 404: + if status_code == 404: raise WrongUUIDError("Missing source {}".format(source.uuid)) - data = res.json() except json.decoder.JSONDecodeError: raise BaseError("Error in parsing JSON") @@ -654,17 +606,17 @@ def get_reply_from_source(self, source: Source, reply_uuid: str) -> Reply: :param reply_uuid: UUID of the reply. :returns: A reply object """ - url = self.server + "api/v1/sources/{}/replies/{}".format( - source.uuid, reply_uuid - ) + path_query = "api/v1/sources/{}/replies/{}".format(source.uuid, reply_uuid) + method = "GET" try: - res = requests.get(url, headers=self.auth_header) + data, status_code, headers = self._send_json_request( + method, path_query, headers=self.auth_header + ) - if res.status_code == 404: + if status_code == 404: raise WrongUUIDError("Missing source {}".format(source.uuid)) - data = res.json() except json.decoder.JSONDecodeError: raise BaseError("Error in parsing JSON") @@ -681,12 +633,14 @@ def get_all_replies(self) -> List[Reply]: :returns: List of Reply objects. """ - url = self.server + "api/v1/replies" + path_query = "api/v1/replies" + method = "GET" try: - res = requests.get(url, headers=self.auth_header) + data, status_code, headers = self._send_json_request( + method, path_query, headers=self.auth_header + ) - data = res.json() except json.decoder.JSONDecodeError: raise BaseError("Error in parsing JSON") @@ -700,7 +654,7 @@ def get_all_replies(self) -> List[Reply]: return result - def download_reply(self, reply: Reply, path: str) -> Tuple[str, str]: + def download_reply(self, reply: Reply, path: str = "") -> Tuple[str, str]: """ Returns a tuple of sha256sum and file path for a given Reply object. This method also requires a directory path in where it will save the reply file. @@ -710,34 +664,46 @@ def download_reply(self, reply: Reply, path: str) -> Tuple[str, str]: :returns: Tuple of sha256sum and path of the saved Reply. """ - url = self.server.rstrip("/") + reply.reply_url + "/download" + path_query = "api/v1/sources/{}/replies/{}/download".format( + reply.source_uuid, reply.uuid + ) + + method = "GET" - if os.path.exists(path) and not os.path.isdir(path): - raise BaseError("Please provide a valid directory to save.") + if path: + if os.path.exists(path) and not os.path.isdir(path): + raise BaseError("Please provide a valid directory to save.") try: - res = requests.get(url, headers=self.auth_header, stream=True) + data, status_code, headers = self._send_json_request( + method, path_query, headers=self.auth_header + ) - if res.status_code == 404: + if status_code == 404: raise WrongUUIDError("Missing reply {}".format(reply.uuid)) # Get the headers - headers = res.headers - etag = headers["Etag"] - - # This is where we will save our downloaded file - filepath = os.path.join(path, reply.filename) - with open(filepath, "wb") as fobj: - for chunk in res.iter_content( - chunk_size=1024 - ): # Getting 1024 in each chunk - if chunk: - fobj.write(chunk) - - # Because etag comes as JSON encoded string - etag = json.loads(etag) + headers = headers + + if not self.proxy: + # This is where we will save our downloaded file + filepath = os.path.join(path, reply.filename) + with open(filepath, "wb") as fobj: + for chunk in data.iter_content( + chunk_size=1024 + ): # Getting 1024 in each chunk + if chunk: + fobj.write(chunk) + + else: + filepath = os.path.join( + "/home/user/QubesIncoming/", proxyvmname, data["filename"] + ) # Return the tuple of sha256sum, filepath - return etag[7:], filepath + # Returning empty string instead of sha256sum due to this + # SecureDrop server bug: + # https://github.com/freedomofpress/securedrop/issues/3877 + return "", filepath except Exception as err: raise BaseError(err) @@ -751,18 +717,19 @@ def delete_reply(self, reply: Reply) -> bool: # Not using direct URL because this helps to use the same method # from local reply (not fetched from server) objects. # See the *from_string for an example. - source_uuid = reply.source_url.split("/")[-1] - url = self.server.rstrip("/") + "/api/v1/sources/{}/replies/{}".format( - source_uuid, reply.uuid + path_query = "api/v1/sources/{}/replies/{}".format( + reply.source_uuid, reply.uuid ) + method = "DELETE" + try: - res = requests.delete(url, headers=self.auth_header) + data, status_code, headers = self._send_json_request( + method, path_query, headers=self.auth_header + ) - if res.status_code == 404: + if status_code == 404: raise WrongUUIDError("Missing reply {}".format(reply.uuid)) - - data = res.json() except json.decoder.JSONDecodeError: raise BaseError("Error in parsing JSON") diff --git a/sdclientapi/sdlocalobjects.py b/sdclientapi/sdlocalobjects.py new file mode 100644 index 0000000..7957b85 --- /dev/null +++ b/sdclientapi/sdlocalobjects.py @@ -0,0 +1,157 @@ +class BaseError(Exception): + pass + + +class ReplyError(BaseError): + "For errors on reply messages" + + def __init__(self, message): + self.msg = message + + def __str__(self): + return repr(self.msg) + + +class WrongUUIDError(BaseError): + "For missing UUID, can be for source or submission" + + def __init__(self, message): + self.msg = message + + def __str__(self): + return repr(self.msg) + + +class AuthError(BaseError): + "For Authentication errors" + + def __init__(self, message): + self.msg = message + + def __str__(self): + return repr(self.msg) + + +class AttributeError(BaseError): + def __init__(self, message): + self.msg = message + + def __str__(self): + return repr(self.msg) + + +class Reply: + """ + This class represents a reply to the source. + """ + + def __init__(self, **kwargs) -> None: + self.filename = "" # type: str + self.journalist_username = "" # type: str + self.journalist_uuid = "" # type: str + self.is_deleted_by_source = False # type: bool + self.reply_url = "" # type: str + self.size = 0 # type: int + self.source_url = "" # type: str + self.source_uuid = "" # type: str + self.uuid = "" # type: str + + for key in [ + "filename", + "journalist_username", + "journalist_uuid", + "is_deleted_by_source", + "reply_url", + "size", + "source_url", + "uuid", + ]: + if not key in kwargs: + AttributeError("Missing key {}".format(key)) + setattr(self, key, kwargs[key]) + + # Now let us set source uuid + values = self.source_url.split("/") + self.source_uuid = values[-1] + + +class Submission: + """ + This class represents a submission object in the server. + """ + + def __init__(self, **kwargs) -> None: + self.download_url = "" # type: str + self.filename = "" # type: str + self.is_read = False # type: bool + self.size = 0 # type: int + self.source_url = "" # type: str + self.source_uuid = "" # type: str + self.submission_url = "" # type: str + self.uuid = "" # type: str + + if ["uuid"] == list(kwargs.keys()): + # Means we are creating an object only for fetching from server. + self.uuid = kwargs["uuid"] + return + + for key in [ + "download_url", + "filename", + "is_read", + "size", + "source_url", + "submission_url", + "uuid", + ]: + if not key in kwargs: + AttributeError("Missing key {}".format(key)) + setattr(self, key, kwargs[key]) + _, self.source_uuid = self.source_url.rsplit("/", 1) + + +class Source: + """ + This class represents a source object in the server. + """ + + def __init__(self, **kwargs): + self.add_star_url = "" # type: str + self.interaction_count = 0 # type: int + self.is_flagged = False # type: bool + self.is_starred = False # type: bool + self.journalist_designation = "" # type: str + self.key = {} # type: Dict + self.last_updated = "" # type: str + self.number_of_documents = 0 # type: int + self.number_of_messages = 0 # type: int + self.remove_star_url = "" # type: str + self.replies_url = "" # type: str + self.submissions_url = "" # type: str + self.url = "" # type: str + self.uuid = "" # type: str + + if ["uuid"] == list(kwargs.keys()): + # Means we are creating an object only for fetching from server. + self.uuid = kwargs["uuid"] + return + + for key in [ + "add_star_url", + "interaction_count", + "is_flagged", + "is_starred", + "journalist_designation", + "key", + "last_updated", + "number_of_documents", + "number_of_messages", + "remove_star_url", + "replies_url", + "submissions_url", + "url", + "uuid", + ]: + if not key in kwargs: + AttributeError("Missing key {}".format(key)) + setattr(self, key, kwargs[key]) diff --git a/tests/test_api.py b/tests/test_api.py index 795344e..224f99b 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -7,24 +7,12 @@ import tempfile import unittest from sdclientapi import * +from utils import * import vcr import pyotp -def load_auth(): - "Helper function to load token" - if os.path.exists("testtoken.json"): - with open("testtoken.json") as fobj: - return json.load(fobj) - return None - - -def save_auth(token): - with open("testtoken.json", "w") as fobj: - json.dump(token, fobj) - - class TestAPI(unittest.TestCase): @vcr.use_cassette("data/test-setup.yml") def setUp(self): @@ -113,7 +101,7 @@ def test_get_submission_from_string(self): @vcr.use_cassette("data/test-get-wrong-submissions.yml") def test_get_wrong_submissions(self): s = self.api.get_sources()[0] - s.submissions_url = "/api/v1/sources/rofl-missing/submissions/2334" + s.uuid = "rofl-missing" with self.assertRaises(WrongUUIDError): self.api.get_submissions(s) @@ -206,15 +194,12 @@ def test_download_submission(self): # We need a temporary directory to download tmpdir = tempfile.mkdtemp() - etag, filepath = self.api.download_submission(s, tmpdir) + _, filepath = self.api.download_submission(s, tmpdir) # now let us read the downloaded file with open(filepath, "rb") as fobj: data = fobj.read() - shasum = hashlib.sha256(data).hexdigest() - self.assertEqual(etag, shasum) - # Now the submission should have is_read as True. s = self.api.get_submission(s) @@ -253,15 +238,12 @@ def test_download_reply(self): # We need a temporary directory to download tmpdir = tempfile.mkdtemp() - etag, filepath = self.api.download_reply(r, tmpdir) + _, filepath = self.api.download_reply(r, tmpdir) # now let us read the downloaded file with open(filepath, "rb") as fobj: data = fobj.read() - shasum = hashlib.sha256(data).hexdigest() - self.assertEqual(etag, shasum) - # Let us remove the temporary directory shutil.rmtree(tmpdir) diff --git a/tests/test_apiproxy.py b/tests/test_apiproxy.py new file mode 100644 index 0000000..2faaeb8 --- /dev/null +++ b/tests/test_apiproxy.py @@ -0,0 +1,239 @@ +from pprint import pprint +import os +import time +import json +import hashlib +import shutil +import tempfile +import unittest +from sdclientapi import * + +from utils import * +import pyotp + + +class TestAPIProxy(unittest.TestCase): + @dastollervey_datasaver + def setUp(self): + self.totp = pyotp.TOTP("JHCOGO7VCER3EJ4L") + self.username = "journalist" + self.password = "correct horse battery staple profanity oil chewy" + self.server = "http://localhost:8081/" + self.api = API(self.server, self.username, self.password, + str(self.totp.now()), proxy=True) + for i in range(3): + try: + self.api.authenticate() + except BaseError: + token = load_auth() + if token: + self.api.token = token + self.api.update_auth_header() + break + time.sleep(31) + + save_auth(self.api.token) + break + + def test_api_auth(self): + self.assertTrue(self.api.token) + + @dastollervey_datasaver + def test_get_sources(self): + sources = self.api.get_sources() + self.assertEqual(len(sources), 2) + + @dastollervey_datasaver + def test_star_add_remove(self): + s = self.api.get_sources()[0] + self.assertTrue(self.api.add_star(s)) + self.assertTrue(self.api.remove_star(s)) + for source in self.api.get_sources(): + if source.uuid == s.uuid: + self.assertFalse(source.is_starred) + + @dastollervey_datasaver + def test_get_single_source(self): + s = self.api.get_sources()[0] + # Now we will try to get the same source again + s2 = self.api.get_source(s) + + self.assertEqual(s.journalist_designation, s2.journalist_designation) + self.assertEqual(s.uuid, s2.uuid) + + @dastollervey_datasaver + def test_get_single_source_from_string(self): + s = self.api.get_sources()[0] + # Now we will try to get the same source again using uuid + s2 = self.api.get_source_from_string(s.uuid) + + self.assertEqual(s.journalist_designation, s2.journalist_designation) + self.assertEqual(s.uuid, s2.uuid) + + @dastollervey_datasaver + def test_failed_single_source(self): + with self.assertRaises(WrongUUIDError): + self.api.get_source(Source(uuid="not there")) + + @dastollervey_datasaver + def test_get_submissions(self): + s = self.api.get_sources()[0] + + subs = self.api.get_submissions(s) + self.assertEqual(len(subs), 2) + + @dastollervey_datasaver + def test_get_submission(self): + s = self.api.get_sources()[0] + + subs = self.api.get_submissions(s) + sub = self.api.get_submission(subs[0]) + self.assertEqual(sub.filename, subs[0].filename) + + @dastollervey_datasaver + def test_get_submission_from_string(self): + s = self.api.get_sources()[0] + + subs = self.api.get_submissions(s) + sub = self.api.get_submission_from_string(subs[0].uuid, s.uuid) + self.assertEqual(sub.filename, subs[0].filename) + + @dastollervey_datasaver + def test_get_wrong_submissions(self): + s = self.api.get_sources()[0] + s.submissions_url = "/api/v1/sources/rofl-missing/submissions/2334" + s.uuid = "rofl-missing" + with self.assertRaises(WrongUUIDError): + self.api.get_submissions(s) + + @dastollervey_datasaver + def test_get_all_submissions(self): + subs = self.api.get_all_submissions() + self.assertEqual(len(subs), 4) + + @dastollervey_datasaver + def test_flag_source(self): + s = self.api.get_sources()[0] + self.assertTrue(self.api.flag_source(s)) + # Now we will try to get the same source again + s2 = self.api.get_source(s) + self.assertTrue(s2.is_flagged) + + @dastollervey_datasaver + def test_delete_source(self): + s = self.api.get_sources()[0] + self.assertTrue(self.api.delete_source(s)) + + # Now there should be one source left + sources = self.api.get_sources() + self.assertEqual(len(sources), 1) + + @dastollervey_datasaver + def test_delete_source_from_string(self): + s = self.api.get_sources()[0] + self.assertTrue(self.api.delete_source_from_string(s.uuid)) + + # Now there should be one source left + sources = self.api.get_sources() + self.assertEqual(len(sources), 1) + + @dastollervey_datasaver + def test_delete_submission(self): + subs = self.api.get_all_submissions() + self.assertTrue(self.api.delete_submission(subs[0])) + new_subs = self.api.get_all_submissions() + # We now should have 3 submissions + self.assertEqual(len(new_subs), 3) + + # Let us make sure that sub[0] is not there + for s in new_subs: + self.assertNotEqual(s.uuid, subs[0].uuid) + + @dastollervey_datasaver + def test_delete_submission_from_string(self): + s = self.api.get_sources()[0] + + subs = self.api.get_submissions(s) + + self.assertTrue(self.api.delete_submission(subs[0])) + new_subs = self.api.get_all_submissions() + # We now should have 3 submissions + self.assertEqual(len(new_subs), 3) + + # Let us make sure that sub[0] is not there + for s in new_subs: + self.assertNotEqual(s.uuid, subs[0].uuid) + + @dastollervey_datasaver + def test_get_current_user(self): + user = self.api.get_current_user() + self.assertTrue(user["is_admin"]) + self.assertEqual(user["username"], "journalist") + + @dastollervey_datasaver + def test_error_unencrypted_reply(self): + s = self.api.get_sources()[0] + with self.assertRaises(ReplyError) as err: + self.api.reply_source(s, "hello") + + self.assertEqual(err.exception.msg, "You must encrypt replies client side") + + @dastollervey_datasaver + def test_reply_source(self): + s = self.api.get_sources()[0] + dirname = os.path.dirname(__file__) + with open(os.path.join(dirname, "encrypted_msg.asc")) as fobj: + data = fobj.read() + + self.assertTrue(self.api.reply_source(s, data)) + + @dastollervey_datasaver + def test_get_replies_from_source(self): + s = self.api.get_sources()[0] + replies = self.api.get_replies_from_source(s) + self.assertEqual(len(replies), 2) + + @dastollervey_datasaver + def test_get_reply_from_source(self): + s = self.api.get_sources()[0] + replies = self.api.get_replies_from_source(s) + reply = replies[0] + + r = self.api.get_reply_from_source(s, reply.uuid) + + self.assertEqual(reply.filename, r.filename) + self.assertEqual(reply.size, r.size) + self.assertEqual(reply.reply_url, r.reply_url) + self.assertEqual(reply.journalist_username, r.journalist_username) + + @dastollervey_datasaver + def test_get_all_replies(self): + replies = self.api.get_all_replies() + self.assertEqual(len(replies), 4) + + @dastollervey_datasaver + def test_delete_reply(self): + r = self.api.get_all_replies()[0] + + self.assertTrue(self.api.delete_reply(r)) + + # We deleted one, so there must be 3 replies left + self.assertEqual(len(self.api.get_all_replies()), 3) + + @dastollervey_datasaver + def test_download_reply(self): + r = self.api.get_all_replies()[0] + + _, filepath = self.api.download_reply(r) + + @dastollervey_datasaver + def test_download_submission(self): + s = self.api.get_all_submissions()[0] + + self.assertFalse(s.is_read) + + _, filepath = self.api.download_submission(s) + + # Now the submission should have is_read as True. + s = self.api.get_submission(s) + self.assertTrue(s.is_read) diff --git a/tests/utils/__init__.py b/tests/utils/__init__.py new file mode 100644 index 0000000..9352712 --- /dev/null +++ b/tests/utils/__init__.py @@ -0,0 +1,104 @@ +import os +import json +from pprint import pprint +from sdclientapi import json_query +from unittest.mock import MagicMock, patch + +from typing import Optional, Dict, List, Tuple + +# We are making calls to securedrop.Proxy qrexec service +# in the QubesOS to get the data from the server. This is difficult to test +# unless we have an easy way to store/cache each function call and returned +# result. In this file we have a new decorator called `dastollervey_datasaver`. +# This decorator checks for each json_query call and related arguments sent +# to the function, and then stores the result in a json file if required. +# From the next time, for the same signature, it will serve the result from the +# stored cache and will enable us to write unittests which can run without a +# real server. +# The result files will be stored in data/function_name.json files. + +RES = {} +CALLNUMBER = 0 + + +alternative = json_query + + +def internal_sideeffect(*args, **kwargs): + global CALLNUMBER + global RES + CALLNUMBER += 1 + arguments = tuple(args) + # Now remove the one time code + # As it will be a different value every time. + python_args = json.loads(args[0]) + + try: + value_str = python_args["body"] + value = json.loads(value_str) + del value["one_time_code"] + python_args["body"] = json.dumps(value, sort_keys=True) + newargs = json.dumps(python_args, sort_keys=True) + arguments = (newargs,) + except: + pass # Means no body in the call + + # Now remove the authorization token from the key + # Because in differnet runs, the token would be different + # that is why we have to remove that. + try: + value = python_args["headers"] + del value["Authorization"] + python_args["headers"] = json.dumps(value, sort_keys=True) + newargs = json.dumps(python_args, sort_keys=True) + arguments = (newargs,) + except Exception as err: + pass # Means no Authorization token in the call + + key = arguments[0] + "+" + str(CALLNUMBER) + answer = RES.get(key, None) + if not answer: + # Means it is not in cache. + # So, execute the real function and store in cache + answer = alternative(*args) + RES[key] = answer + return answer + + +def dastollervey_datasaver(func): + "This is the decorator to save qrexec call data" + + def wrapper(*args, **kwargs): + global CALLNUMBER + global RES + # This is the filename to store the results + filename = os.path.join("data", func.__name__ + ".json") + + if os.path.exists(filename): + with open(filename) as fobj: + RES = json.load(fobj) + mock = MagicMock() + mock.side_effect = internal_sideeffect + with patch("sdclientapi.json_query", mock): + result = func(*args, **kwargs) + + if not os.path.exists(filename): + with open(filename, "w") as fobj: + json.dump(RES, fobj) + CALLNUMBER = 0 + return result + + return wrapper + + +def load_auth(): + "Helper function to load token" + if os.path.exists("testtoken.json"): + with open("testtoken.json") as fobj: + return json.load(fobj) + return None + + +def save_auth(token): + with open("testtoken.json", "w") as fobj: + json.dump(token, fobj)