diff --git a/.gitignore b/.gitignore index 5853188..013be49 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +#environment variables +.env +src/.env + # mac junk .DS_Store diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..a997c2b --- /dev/null +++ b/Pipfile @@ -0,0 +1,18 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +pytest = "*" +flask = "*" +pymongo = "*" +python-dotenv = "*" +flask-login = "*" +flask-bcrypt = "*" +pytest-cov = "*" + +[dev-packages] + +[requires] +python_version = "3.8" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..72bf0b0 --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,373 @@ +{ + "_meta": { + "hash": { + "sha256": "50c6da81350ce9ee2e631aaca5226bb0d3e3d932f8aecda194e436a0a28f333b" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.8" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "bcrypt": { + "hashes": [ + "sha256:02d9ef8915f72dd6daaef40e0baeef8a017ce624369f09754baf32bb32dba25f", + "sha256:1c28973decf4e0e69cee78c68e30a523be441972c826703bb93099868a8ff5b5", + "sha256:2a298db2a8ab20056120b45e86c00a0a5eb50ec4075b6142db35f593b97cb3fb", + "sha256:33313a1200a3ae90b75587ceac502b048b840fc69e7f7a0905b5f87fac7a1258", + "sha256:3566a88234e8de2ccae31968127b0ecccbb4cddb629da744165db72b58d88ca4", + "sha256:387e7e1af9a4dd636b9505a465032f2f5cb8e61ba1120e79a0e1cd0b512f3dfc", + "sha256:44290ccc827d3a24604f2c8bcd00d0da349e336e6503656cb8192133e27335e2", + "sha256:57fa9442758da926ed33a91644649d3e340a71e2d0a5a8de064fb621fd5a3326", + "sha256:68e3c6642077b0c8092580c819c1684161262b2e30c4f45deb000c38947bf483", + "sha256:69057b9fc5093ea1ab00dd24ede891f3e5e65bee040395fb1e66ee196f9c9b4a", + "sha256:6cad43d8c63f34b26aef462b6f5e44fdcf9860b723d2453b5d391258c4c8e966", + "sha256:71b8be82bc46cedd61a9f4ccb6c1a493211d031415a34adde3669ee1b0afbb63", + "sha256:732b3920a08eacf12f93e6b04ea276c489f1c8fb49344f564cca2adb663b3e4c", + "sha256:9800ae5bd5077b13725e2e3934aa3c9c37e49d3ea3d06318010aa40f54c63551", + "sha256:a97e07e83e3262599434816f631cc4c7ca2aa8e9c072c1b1a7fec2ae809a1d2d", + "sha256:ac621c093edb28200728a9cca214d7e838529e557027ef0581685909acd28b5e", + "sha256:b8df79979c5bae07f1db22dcc49cc5bccf08a0380ca5c6f391cbb5790355c0b0", + "sha256:b90e216dc36864ae7132cb151ffe95155a37a14e0de3a8f64b49655dd959ff9c", + "sha256:ba4e4cc26610581a6329b3937e02d319f5ad4b85b074846bf4fef8a8cf51e7bb", + "sha256:ba55e40de38a24e2d78d34c2d36d6e864f93e0d79d0b6ce915e4335aa81d01b1", + "sha256:be3ab1071662f6065899fe08428e45c16aa36e28bc42921c4901a191fda6ee42", + "sha256:d75fc8cd0ba23f97bae88a6ec04e9e5351ff3c6ad06f38fe32ba50cbd0d11946", + "sha256:e51c42750b7585cee7892c2614be0d14107fad9581d1738d954a262556dd1aab", + "sha256:ea505c97a5c465ab8c3ba75c0805a102ce526695cd6818c6de3b1a38f6f60da1", + "sha256:eb3bd3321517916696233b5e0c67fd7d6281f0ef48e66812db35fc963a422a1c", + "sha256:f70d9c61f9c4ca7d57f3bfe88a5ccf62546ffbadf3681bb1e268d9d2e41c91a7", + "sha256:fbe188b878313d01b7718390f31528be4010fed1faa798c5a1d0469c9c48c369" + ], + "markers": "python_version >= '3.7'", + "version": "==4.1.2" + }, + "blinker": { + "hashes": [ + "sha256:5f1cdeff423b77c31b89de0565cd03e5275a03028f44b2b15f912632a58cced6", + "sha256:da44ec748222dcd0105ef975eed946da197d5bdf8bafb6aa92f5bc89da63fa25" + ], + "markers": "python_version >= '3.8'", + "version": "==1.8.1" + }, + "click": { + "hashes": [ + "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28", + "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de" + ], + "markers": "python_version >= '3.7'", + "version": "==8.1.7" + }, + "coverage": { + "extras": [ + "toml" + ], + "hashes": [ + "sha256:075299460948cd12722a970c7eae43d25d37989da682997687b34ae6b87c0ef0", + "sha256:07dfdd492d645eea1bd70fb1d6febdcf47db178b0d99161d8e4eed18e7f62fe7", + "sha256:0cbdf2cae14a06827bec50bd58e49249452d211d9caddd8bd80e35b53cb04631", + "sha256:2055c4fb9a6ff624253d432aa471a37202cd8f458c033d6d989be4499aed037b", + "sha256:262fffc1f6c1a26125d5d573e1ec379285a3723363f3bd9c83923c9593a2ac25", + "sha256:280132aada3bc2f0fac939a5771db4fbb84f245cb35b94fae4994d4c1f80dae7", + "sha256:2b57780b51084d5223eee7b59f0d4911c31c16ee5aa12737c7a02455829ff067", + "sha256:2bd7065249703cbeb6d4ce679c734bef0ee69baa7bff9724361ada04a15b7e3b", + "sha256:3235d7c781232e525b0761730e052388a01548bd7f67d0067a253887c6e8df46", + "sha256:33c020d3322662e74bc507fb11488773a96894aa82a622c35a5a28673c0c26f5", + "sha256:357754dcdfd811462a725e7501a9b4556388e8ecf66e79df6f4b988fa3d0b39a", + "sha256:39793731182c4be939b4be0cdecde074b833f6171313cf53481f869937129ed3", + "sha256:3c2b77f295edb9fcdb6a250f83e6481c679335ca7e6e4a955e4290350f2d22a4", + "sha256:41327143c5b1d715f5f98a397608f90ab9ebba606ae4e6f3389c2145410c52b1", + "sha256:427e1e627b0963ac02d7c8730ca6d935df10280d230508c0ba059505e9233475", + "sha256:432949a32c3e3f820af808db1833d6d1631664d53dd3ce487aa25d574e18ad1c", + "sha256:4ba01d9ba112b55bfa4b24808ec431197bb34f09f66f7cb4fd0258ff9d3711b1", + "sha256:4d0e206259b73af35c4ec1319fd04003776e11e859936658cb6ceffdeba0f5be", + "sha256:51431d0abbed3a868e967f8257c5faf283d41ec882f58413cf295a389bb22e58", + "sha256:565b2e82d0968c977e0b0f7cbf25fd06d78d4856289abc79694c8edcce6eb2de", + "sha256:6782cd6216fab5a83216cc39f13ebe30adfac2fa72688c5a4d8d180cd52e8f6a", + "sha256:6afd2e84e7da40fe23ca588379f815fb6dbbb1b757c883935ed11647205111cb", + "sha256:710c62b6e35a9a766b99b15cdc56d5aeda0914edae8bb467e9c355f75d14ee95", + "sha256:84921b10aeb2dd453247fd10de22907984eaf80901b578a5cf0bb1e279a587cb", + "sha256:85a5dbe1ba1bf38d6c63b6d2c42132d45cbee6d9f0c51b52c59aa4afba057517", + "sha256:9c6384cc90e37cfb60435bbbe0488444e54b98700f727f16f64d8bfda0b84656", + "sha256:9dd88fce54abbdbf4c42fb1fea0e498973d07816f24c0e27a1ecaf91883ce69e", + "sha256:a81eb64feded34f40c8986869a2f764f0fe2db58c0530d3a4afbcde50f314880", + "sha256:a898c11dca8f8c97b467138004a30133974aacd572818c383596f8d5b2eb04a9", + "sha256:a9960dd1891b2ddf13a7fe45339cd59ecee3abb6b8326d8b932d0c5da208104f", + "sha256:a9a7ef30a1b02547c1b23fa9a5564f03c9982fc71eb2ecb7f98c96d7a0db5cf2", + "sha256:ad97ec0da94b378e593ef532b980c15e377df9b9608c7c6da3506953182398af", + "sha256:adf032b6c105881f9d77fa17d9eebe0ad1f9bfb2ad25777811f97c5362aa07f2", + "sha256:bbfe6389c5522b99768a93d89aca52ef92310a96b99782973b9d11e80511f932", + "sha256:bd4bacd62aa2f1a1627352fe68885d6ee694bdaebb16038b6e680f2924a9b2cc", + "sha256:bf0b4b8d9caa8d64df838e0f8dcf68fb570c5733b726d1494b87f3da85db3a2d", + "sha256:c379cdd3efc0658e652a14112d51a7668f6bfca7445c5a10dee7eabecabba19d", + "sha256:c58536f6892559e030e6924896a44098bc1290663ea12532c78cef71d0df8493", + "sha256:cbe6581fcff7c8e262eb574244f81f5faaea539e712a058e6707a9d272fe5b64", + "sha256:ced268e82af993d7801a9db2dbc1d2322e786c5dc76295d8e89473d46c6b84d4", + "sha256:cf3539007202ebfe03923128fedfdd245db5860a36810136ad95a564a2fdffff", + "sha256:cf62d17310f34084c59c01e027259076479128d11e4661bb6c9acb38c5e19bb8", + "sha256:d0194d654e360b3e6cc9b774e83235bae6b9b2cac3be09040880bb0e8a88f4a1", + "sha256:d3d117890b6eee85887b1eed41eefe2e598ad6e40523d9f94c4c4b213258e4a4", + "sha256:db2de4e546f0ec4b2787d625e0b16b78e99c3e21bc1722b4977c0dddf11ca84e", + "sha256:e768d870801f68c74c2b669fc909839660180c366501d4cc4b87efd6b0eee375", + "sha256:e7c211f25777746d468d76f11719e64acb40eed410d81c26cefac641975beb88", + "sha256:eed462b4541c540d63ab57b3fc69e7d8c84d5957668854ee4e408b50e92ce26a", + "sha256:f0bfe42523893c188e9616d853c47685e1c575fe25f737adf473d0405dcfa7eb", + "sha256:f609ebcb0242d84b7adeee2b06c11a2ddaec5464d21888b2c8255f5fd6a98ae4", + "sha256:fea9d3ca80bcf17edb2c08a4704259dadac196fe5e9274067e7a20511fad1743", + "sha256:fed7a72d54bd52f4aeb6c6e951f363903bd7d70bc1cad64dd1f087980d309ab9" + ], + "markers": "python_version >= '3.8'", + "version": "==7.5.0" + }, + "dnspython": { + "hashes": [ + "sha256:5ef3b9680161f6fa89daf8ad451b5f1a33b18ae8a1c6778cdf4b43f08c0a6e50", + "sha256:e8f0f9c23a7b7cb99ded64e6c3a6f3e701d78f50c55e002b839dea7225cff7cc" + ], + "markers": "python_version >= '3.8'", + "version": "==2.6.1" + }, + "flask": { + "hashes": [ + "sha256:34e815dfaa43340d1d15a5c3a02b8476004037eb4840b34910c6e21679d288f3", + "sha256:ceb27b0af3823ea2737928a4d99d125a06175b8512c445cbd9a9ce200ef76842" + ], + "index": "pypi", + "markers": "python_version >= '3.8'", + "version": "==3.0.3" + }, + "flask-bcrypt": { + "hashes": [ + "sha256:062fd991dc9118d05ac0583675507b9fe4670e44416c97e0e6819d03d01f808a", + "sha256:f07b66b811417ea64eb188ae6455b0b708a793d966e1a80ceec4a23bc42a4369" + ], + "index": "pypi", + "version": "==1.0.1" + }, + "flask-login": { + "hashes": [ + "sha256:5e23d14a607ef12806c699590b89d0f0e0d67baeec599d75947bf9c147330333", + "sha256:849b25b82a436bf830a054e74214074af59097171562ab10bfa999e6b78aae5d" + ], + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==0.6.3" + }, + "iniconfig": { + "hashes": [ + "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", + "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374" + ], + "markers": "python_version >= '3.7'", + "version": "==2.0.0" + }, + "itsdangerous": { + "hashes": [ + "sha256:c6242fc49e35958c8b15141343aa660db5fc54d4f13a1db01a3f5891b98700ef", + "sha256:e0050c0b7da1eea53ffaf149c0cfbb5c6e2e2b69c4bef22c81fa6eb73e5f6173" + ], + "markers": "python_version >= '3.8'", + "version": "==2.2.0" + }, + "jinja2": { + "hashes": [ + "sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa", + "sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90" + ], + "markers": "python_version >= '3.7'", + "version": "==3.1.3" + }, + "markupsafe": { + "hashes": [ + "sha256:00e046b6dd71aa03a41079792f8473dc494d564611a8f89bbbd7cb93295ebdcf", + "sha256:075202fa5b72c86ad32dc7d0b56024ebdbcf2048c0ba09f1cde31bfdd57bcfff", + "sha256:0e397ac966fdf721b2c528cf028494e86172b4feba51d65f81ffd65c63798f3f", + "sha256:17b950fccb810b3293638215058e432159d2b71005c74371d784862b7e4683f3", + "sha256:1f3fbcb7ef1f16e48246f704ab79d79da8a46891e2da03f8783a5b6fa41a9532", + "sha256:2174c595a0d73a3080ca3257b40096db99799265e1c27cc5a610743acd86d62f", + "sha256:2b7c57a4dfc4f16f7142221afe5ba4e093e09e728ca65c51f5620c9aaeb9a617", + "sha256:2d2d793e36e230fd32babe143b04cec8a8b3eb8a3122d2aceb4a371e6b09b8df", + "sha256:30b600cf0a7ac9234b2638fbc0fb6158ba5bdcdf46aeb631ead21248b9affbc4", + "sha256:397081c1a0bfb5124355710fe79478cdbeb39626492b15d399526ae53422b906", + "sha256:3a57fdd7ce31c7ff06cdfbf31dafa96cc533c21e443d57f5b1ecc6cdc668ec7f", + "sha256:3c6b973f22eb18a789b1460b4b91bf04ae3f0c4234a0a6aa6b0a92f6f7b951d4", + "sha256:3e53af139f8579a6d5f7b76549125f0d94d7e630761a2111bc431fd820e163b8", + "sha256:4096e9de5c6fdf43fb4f04c26fb114f61ef0bf2e5604b6ee3019d51b69e8c371", + "sha256:4275d846e41ecefa46e2015117a9f491e57a71ddd59bbead77e904dc02b1bed2", + "sha256:4c31f53cdae6ecfa91a77820e8b151dba54ab528ba65dfd235c80b086d68a465", + "sha256:4f11aa001c540f62c6166c7726f71f7573b52c68c31f014c25cc7901deea0b52", + "sha256:5049256f536511ee3f7e1b3f87d1d1209d327e818e6ae1365e8653d7e3abb6a6", + "sha256:58c98fee265677f63a4385256a6d7683ab1832f3ddd1e66fe948d5880c21a169", + "sha256:598e3276b64aff0e7b3451b72e94fa3c238d452e7ddcd893c3ab324717456bad", + "sha256:5b7b716f97b52c5a14bffdf688f971b2d5ef4029127f1ad7a513973cfd818df2", + "sha256:5dedb4db619ba5a2787a94d877bc8ffc0566f92a01c0ef214865e54ecc9ee5e0", + "sha256:619bc166c4f2de5caa5a633b8b7326fbe98e0ccbfacabd87268a2b15ff73a029", + "sha256:629ddd2ca402ae6dbedfceeba9c46d5f7b2a61d9749597d4307f943ef198fc1f", + "sha256:656f7526c69fac7f600bd1f400991cc282b417d17539a1b228617081106feb4a", + "sha256:6ec585f69cec0aa07d945b20805be741395e28ac1627333b1c5b0105962ffced", + "sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5", + "sha256:7502934a33b54030eaf1194c21c692a534196063db72176b0c4028e140f8f32c", + "sha256:7a68b554d356a91cce1236aa7682dc01df0edba8d043fd1ce607c49dd3c1edcf", + "sha256:7b2e5a267c855eea6b4283940daa6e88a285f5f2a67f2220203786dfa59b37e9", + "sha256:823b65d8706e32ad2df51ed89496147a42a2a6e01c13cfb6ffb8b1e92bc910bb", + "sha256:8590b4ae07a35970728874632fed7bd57b26b0102df2d2b233b6d9d82f6c62ad", + "sha256:8dd717634f5a044f860435c1d8c16a270ddf0ef8588d4887037c5028b859b0c3", + "sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1", + "sha256:97cafb1f3cbcd3fd2b6fbfb99ae11cdb14deea0736fc2b0952ee177f2b813a46", + "sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc", + "sha256:a549b9c31bec33820e885335b451286e2969a2d9e24879f83fe904a5ce59d70a", + "sha256:ac07bad82163452a6884fe8fa0963fb98c2346ba78d779ec06bd7a6262132aee", + "sha256:ae2ad8ae6ebee9d2d94b17fb62763125f3f374c25618198f40cbb8b525411900", + "sha256:b91c037585eba9095565a3556f611e3cbfaa42ca1e865f7b8015fe5c7336d5a5", + "sha256:bc1667f8b83f48511b94671e0e441401371dfd0f0a795c7daa4a3cd1dde55bea", + "sha256:bec0a414d016ac1a18862a519e54b2fd0fc8bbfd6890376898a6c0891dd82e9f", + "sha256:bf50cd79a75d181c9181df03572cdce0fbb75cc353bc350712073108cba98de5", + "sha256:bff1b4290a66b490a2f4719358c0cdcd9bafb6b8f061e45c7a2460866bf50c2e", + "sha256:c061bb86a71b42465156a3ee7bd58c8c2ceacdbeb95d05a99893e08b8467359a", + "sha256:c8b29db45f8fe46ad280a7294f5c3ec36dbac9491f2d1c17345be8e69cc5928f", + "sha256:ce409136744f6521e39fd8e2a24c53fa18ad67aa5bc7c2cf83645cce5b5c4e50", + "sha256:d050b3361367a06d752db6ead6e7edeb0009be66bc3bae0ee9d97fb326badc2a", + "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b", + "sha256:d9fad5155d72433c921b782e58892377c44bd6252b5af2f67f16b194987338a4", + "sha256:daa4ee5a243f0f20d528d939d06670a298dd39b1ad5f8a72a4275124a7819eff", + "sha256:db0b55e0f3cc0be60c1f19efdde9a637c32740486004f20d1cff53c3c0ece4d2", + "sha256:e61659ba32cf2cf1481e575d0462554625196a1f2fc06a1c777d3f48e8865d46", + "sha256:ea3d8a3d18833cf4304cd2fc9cbb1efe188ca9b5efef2bdac7adc20594a0e46b", + "sha256:ec6a563cff360b50eed26f13adc43e61bc0c04d94b8be985e6fb24b81f6dcfdf", + "sha256:f5dfb42c4604dddc8e4305050aa6deb084540643ed5804d7455b5df8fe16f5e5", + "sha256:fa173ec60341d6bb97a89f5ea19c85c5643c1e7dedebc22f5181eb73573142c5", + "sha256:fa9db3f79de01457b03d4f01b34cf91bc0048eb2c3846ff26f66687c2f6d16ab", + "sha256:fce659a462a1be54d2ffcacea5e3ba2d74daa74f30f5f143fe0c58636e355fdd", + "sha256:ffee1f21e5ef0d712f9033568f8344d5da8cc2869dbd08d87c84656e6a2d2f68" + ], + "markers": "python_version >= '3.7'", + "version": "==2.1.5" + }, + "packaging": { + "hashes": [ + "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5", + "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9" + ], + "markers": "python_version >= '3.7'", + "version": "==24.0" + }, + "pluggy": { + "hashes": [ + "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", + "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669" + ], + "markers": "python_version >= '3.8'", + "version": "==1.5.0" + }, + "pymongo": { + "hashes": [ + "sha256:11f74dafde63ad2dc30c01f40b4c69d9af157f8ba5224b0c9d4de7158537266f", + "sha256:13fc201e073644acd77860d9e91ccfc27addf510563e07381cadc9a55ac3a894", + "sha256:1bd1eef70c1eda838b26397ef75c9580d7a97fd94b6324971d7f3d2ad3552e9a", + "sha256:24c8f1dd545360ec1b79007a3ba6573af565df6fde49f6dfc53813f3f475a751", + "sha256:253ed8fd6e7f4b2a1caa89e6b287b9e04f42613319ee1e1240c2db2afe1637e7", + "sha256:263c169302df636f9086b584994a51d0adfc8738fe27d7b8e2aacf46fd68b6cb", + "sha256:297cdc87c4b4168782b571c8643540e9b0ad1d09266b43d2f5954f8632280835", + "sha256:2ccc8dd4fe9aac18dde27c33a53271c6c90159b74c43fbdab1d33d5efc36c2f5", + "sha256:30a9d891631d7e847b24f551b1d89ff2033539e7cd8e9af29714b4d0db7abb06", + "sha256:31ed8ba3da0366346264604b3a443f5a4232cab5ed45f520bead6184cf0851a1", + "sha256:337d99f88d32a5f8056d6d2bc365ccf09d09583f3942882c50cf11b459e8fbc0", + "sha256:3ef32a7cfe748c0c72fdad9e51459de5e0c6b16c5288b39f863abfff23503847", + "sha256:455f9d603ed0990a787773d5718e871300bddf585ce543baf129c9f5ca3adb02", + "sha256:45ac46f0d6bdc2baac34ced60aae27b2083170d77397330eff0ac5689ea29d38", + "sha256:4c7e05454cdc5aa4702e03cad0df4205daccd6fd631bbbf0a85bbe598129a6cc", + "sha256:4d227555be35078b53f506f6b58bd0b0e8fd4513e89e6f29e83a97efab439250", + "sha256:4dd998e9f0f7694032c1648c7f57fccaa78903df6329b8f8ae20cfa7c4ceca34", + "sha256:5119c66af8c4197c8757b4b7d98c443e5b127c224ac92fb657dbe2b512ae2713", + "sha256:57b5b485ef89270ed2e603814f43f0fdd9b8ba5d4039124d90878cdc2327000c", + "sha256:58989bcb94233233a71645236b972835d4f87a6bb1b7e818d38a7e6e6d4630de", + "sha256:5a58b6cd7c423ba49db10d8445756062c931ad2246ba0da1e705bf22962fd9e9", + "sha256:5ae1aeeb405c29885266666dc7115792d647ed68cfdb6ed02e2e211d12f2e1c8", + "sha256:5bc87db2e9563295c4e45602ab978a2fcbaba3ab89e745503b24f895cddeb755", + "sha256:5ff6d56ca1f0cd3687a13ce90a32a8efb3cc3a53728e5ac160c4c30d10385a72", + "sha256:615c7573d7a9c4837332a673fdc5a5f214b474dd52d846bcf4cc3d011550bee1", + "sha256:64b69b9cd8a6d23881a80490d575e92918f9afca43096a7d6c1013d6b3e5c75c", + "sha256:65c45682d5ed8c6618bde22cd6716b47a197f4ef800a025213b28d13a59e5fca", + "sha256:67cbee427c263a4483e3249fef480788ccc16edb1a4fc330c4c6cb0cb9db94a8", + "sha256:7247c1dc7d8eed4e24eb1dd92c4c58ebf1e5159500015652552acfdebdeed256", + "sha256:73bf96ece4999b0bbab7169cb2b9c60918b434487009e48be4bd47eeb2aa7b14", + "sha256:7b10603ba64af08f5af7eb9a69d6b24e3c69d91fdd48c54b95e284686c1c582d", + "sha256:811a07bba9d35f1e34159ede632ac71dbc429b372a20004e32d6578af872db1a", + "sha256:811c41c6227b7548afcb53e1b996c25262d837b5e5f519e2ddc2c7e59d8728a5", + "sha256:85b8dd3756b73993b1e3ab6b1cba826b9e4987a094a5d5b6d37313776458cd94", + "sha256:887d043ecc0c7d5591925bbc7abb67caf21c94d6e6e5d442cb49eb5d9d8ee76b", + "sha256:8cee62188127a126f59ea45d3981868a5e35343be4ef4ad8712eaf42be37a00b", + "sha256:9e0a30a022ac8a9164ee5a4b761e13dbb3d10a21845f7258011e3415151fb645", + "sha256:9e99dac3c7c2cb498937cc1767361851099da38861e921113318c87d71e3d127", + "sha256:a46c08ef0b273c415b1e8933f6739596be264ae700a4927f84e0b84e70fdf0eb", + "sha256:a848249d5b4763497add62f7dd7bd0ce1538129bf42f4cb132a76d24c61bf98d", + "sha256:aa354933a158e57494c98b592f46d5d24d1b109e6ba05a05179cde719d9f7fd3", + "sha256:ad360630c221aee7c0841a51851496a3ca6fdea87007098a982c1aa26e34083a", + "sha256:b897b60b2d55c26f3efea0effc11b655db68125c3731274bc3953375e9ccab73", + "sha256:b8b95e2163b73d03a913efa89b0f7c5012be82efd4e9dbce8aa62010a75a277c", + "sha256:bfd5c7e5bb87171a5296fa32205adb50b27704a612036ec4395c3cd316fc0e91", + "sha256:c808098f2cdb87d4035144e536ba5fa7709d0420c17b68e6ace5da18c38ded5f", + "sha256:d1829a7db720ff586aaf59c806e89e0a388548063aa844d21a570a231ad8ca87", + "sha256:d50969de00d3522b2c394f7e59b843871e2be4b525af92066da7f3bd02799fdc", + "sha256:d63f38454a2e23c117d3ceab3b661568f2418536825787256ad24e5baaedfd27", + "sha256:d804eaf19a65211cc2c8c5db75be685c3f31c64cdab639794f66f13f8e258ba6", + "sha256:daf35ab13b86aba7cc8c4b019882f1fa8d287a26f586ef5eaf60a5233d3eaa52", + "sha256:dbc32217c81d87750401fa1c2bc9450e854b23e6e30243c82d3514b8e58f39e3", + "sha256:e175d74c52b6c8414a4b4504a2dd42b0202d101b2eb9508a34c137357683864e", + "sha256:e4a63ba6813a2168ebd35ea5369f6c33f7787525986cd77668b7956acc3d2a38", + "sha256:e935712b17e7a42831022353bac91a346a792658a54e12bec907ec11695cc899", + "sha256:ec94d29103317aa920dae59ed385de9604cb0ef840b5b7137b5eaa7a2042580a", + "sha256:ed6b3a0740efe98bb03ccf054578e9788ebcd06d021d548b8217ab2c82e45975", + "sha256:f2a720e787c9b9b912db5bb4c3e7123ccff1352d6c3ac0cb2c7ee392cdc95c00", + "sha256:f8822614975038e0cece47d12e7634a79c2ee590a0ae78ae64c37b9c6610a14c", + "sha256:fb1a884b1c6aeac5ffeb8ccb696fbc242a7ae1bba36f2328c01f76fab7221b94" + ], + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==4.7.1" + }, + "pytest": { + "hashes": [ + "sha256:1733f0620f6cda4095bbf0d9ff8022486e91892245bb9e7d5542c018f612f233", + "sha256:d507d4482197eac0ba2bae2e9babf0672eb333017bcedaa5fb1a3d42c1174b3f" + ], + "index": "pypi", + "markers": "python_version >= '3.8'", + "version": "==8.2.0" + }, + "pytest-cov": { + "hashes": [ + "sha256:4f0764a1219df53214206bf1feea4633c3b558a2925c8b59f144f682861ce652", + "sha256:5837b58e9f6ebd335b0f8060eecce69b662415b16dc503883a02f45dfeb14857" + ], + "index": "pypi", + "markers": "python_version >= '3.8'", + "version": "==5.0.0" + }, + "python-dotenv": { + "hashes": [ + "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca", + "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a" + ], + "index": "pypi", + "markers": "python_version >= '3.8'", + "version": "==1.0.1" + }, + "werkzeug": { + "hashes": [ + "sha256:3aac3f5da756f93030740bc235d3e09449efcf65f2f55e3602e1d851b8f48795", + "sha256:e39b645a6ac92822588e7b39a692e7828724ceae0b0d702ef96701f90e70128d" + ], + "markers": "python_version >= '3.8'", + "version": "==3.0.2" + } + }, + "develop": {} +} diff --git a/data/.mongodb/mongosh/662b3261221b58109f2202d7_log b/data/.mongodb/mongosh/662b3261221b58109f2202d7_log new file mode 100644 index 0000000..91a35a2 --- /dev/null +++ b/data/.mongodb/mongosh/662b3261221b58109f2202d7_log @@ -0,0 +1,14 @@ +{"t":{"$date":"2024-04-26T04:49:37.920Z"},"s":"I","c":"MONGOSH","id":1000000000,"ctx":"log","msg":"Starting log","attr":{"execPath":"/usr/bin/mongosh","envInfo":{"EDITOR":null,"NODE_OPTIONS":null,"TERM":null},"version":"2.2.5","distributionKind":"compiled","buildArch":"x64","buildPlatform":"linux","buildTarget":"linux-x64","buildTime":"2024-04-24T14:22:21.076Z","gitVersion":"3a95f1de5ce644bf6e5453c73b6ccd05a35dcfa5","nodeVersion":"v20.12.2","opensslVersion":"3.0.13+quic","sharedOpenssl":false,"runtimeArch":"x64","runtimePlatform":"linux","runtimeGlibcVersion":"2.35","deps":{"nodeDriverVersion":"6.5.0","libmongocryptVersion":"1.9.0-20230828+git8e7f69f1c0","libmongocryptNodeBindingsVersion":"6.0.0","kerberosVersion":"2.1.0"}}} +{"t":{"$date":"2024-04-26T04:49:37.934Z"},"s":"I","c":"MONGOSH","id":1000000005,"ctx":"config","msg":"User updated"} +{"t":{"$date":"2024-04-26T04:49:37.935Z"},"s":"I","c":"MONGOSH","id":1000000048,"ctx":"config","msg":"Loading global configuration file","attr":{"filename":"/etc/mongosh.conf","found":false}} +{"t":{"$date":"2024-04-26T04:49:37.962Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000042,"ctx":"mongosh-connect","msg":"Initiating connection attempt","attr":{"uri":"mongodb://127.0.0.1:27017/admin?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.5","driver":{"name":"nodejs|mongosh","version":"6.5.0|2.2.5"},"devtoolsConnectVersion":"2.6.0","host":"127.0.0.1:27017"}} +{"t":{"$date":"2024-04-26T04:49:37.974Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000035,"ctx":"mongosh-connect","msg":"Server heartbeat succeeded","attr":{"connectionId":"127.0.0.1:27017"}} +{"t":{"$date":"2024-04-26T04:49:38.042Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000037,"ctx":"mongosh-connect","msg":"Connection attempt finished"} +{"t":{"$date":"2024-04-26T04:49:38.082Z"},"s":"I","c":"MONGOSH","id":1000000004,"ctx":"connect","msg":"Connecting to server","attr":{"session_id":"662b3261221b58109f2202d7","userId":null,"telemetryAnonymousId":"662b3261fb0e9fa0142202d6","connectionUri":"mongodb://:27017/admin?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.5","is_atlas":false,"is_localhost":true,"is_do":false,"server_version":"7.0.8","node_version":"v20.12.2","mongosh_version":"2.2.5","server_os":"linux","server_arch":"x86_64","is_enterprise":false,"auth_type":null,"is_data_federation":false,"is_stream":false,"dl_version":null,"atlas_version":null,"is_genuine":true,"non_genuine_server_name":"mongodb","is_local_atlas":false,"fcv":"7.0","api_version":null,"api_strict":null,"api_deprecation_errors":null}} +{"t":{"$date":"2024-04-26T04:49:38.088Z"},"s":"I","c":"MONGOSH","id":1000000010,"ctx":"shell-api","msg":"Initialized context","attr":{"method":"setCtx","arguments":{}}} +{"t":{"$date":"2024-04-26T04:49:38.092Z"},"s":"I","c":"MONGOSH-SNIPPETS","id":1000000024,"ctx":"snippets","msg":"Fetching snippet index","attr":{"refreshMode":"allow-cached"}} +{"t":{"$date":"2024-04-26T04:49:38.095Z"},"s":"I","c":"MONGOSH-SNIPPETS","id":1000000019,"ctx":"snippets","msg":"Loaded snippets","attr":{"installdir":"/data/db/.mongodb/mongosh/snippets"}} +{"t":{"$date":"2024-04-26T04:49:38.191Z"},"s":"I","c":"MONGOSH-SNIPPETS","id":1000000028,"ctx":"snippets","msg":"Modifying snippets package.json failed","attr":{"error":"ENOENT: no such file or directory, open '/data/db/.mongodb/mongosh/snippets/package.json'"}} +{"t":{"$date":"2024-04-26T04:49:38.207Z"},"s":"I","c":"MONGOSH","id":1000000002,"ctx":"repl","msg":"Started REPL","attr":{"version":"2.2.5"}} +{"t":{"$date":"2024-04-26T04:49:38.380Z"},"s":"I","c":"MONGOSH","id":1000000011,"ctx":"shell-api","msg":"Performed API call","attr":{"method":"createUser","class":"Database","db":"admin","arguments":{}}} +{"t":{"$date":"2024-04-26T04:49:38.518Z"},"s":"I","c":"MONGOSH","id":1000000045,"ctx":"analytics","msg":"Flushed outstanding data","attr":{"flushError":"Trying to persist throttle state before userId is set","flushDuration":0}} diff --git a/data/.mongodb/mongosh/662b3261fb0e9fa0142202d7_log b/data/.mongodb/mongosh/662b3261fb0e9fa0142202d7_log new file mode 100644 index 0000000..6bb8bca --- /dev/null +++ b/data/.mongodb/mongosh/662b3261fb0e9fa0142202d7_log @@ -0,0 +1,5 @@ +{"t":{"$date":"2024-04-26T04:49:37.170Z"},"s":"I","c":"MONGOSH","id":1000000000,"ctx":"log","msg":"Starting log","attr":{"execPath":"/usr/bin/mongosh","envInfo":{"EDITOR":null,"NODE_OPTIONS":null,"TERM":null},"version":"2.2.5","distributionKind":"compiled","buildArch":"x64","buildPlatform":"linux","buildTarget":"linux-x64","buildTime":"2024-04-24T14:22:21.076Z","gitVersion":"3a95f1de5ce644bf6e5453c73b6ccd05a35dcfa5","nodeVersion":"v20.12.2","opensslVersion":"3.0.13+quic","sharedOpenssl":false,"runtimeArch":"x64","runtimePlatform":"linux","runtimeGlibcVersion":"2.35","deps":{"nodeDriverVersion":"6.5.0","libmongocryptVersion":"1.9.0-20230828+git8e7f69f1c0","libmongocryptNodeBindingsVersion":"6.0.0","kerberosVersion":"2.1.0"}}} +{"t":{"$date":"2024-04-26T04:49:37.216Z"},"s":"I","c":"MONGOSH","id":1000000048,"ctx":"config","msg":"Loading global configuration file","attr":{"filename":"/etc/mongosh.conf","found":false}} +{"t":{"$date":"2024-04-26T04:49:37.268Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000042,"ctx":"mongosh-connect","msg":"Initiating connection attempt","attr":{"uri":"mongodb://127.0.0.1:27017/admin?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.5","driver":{"name":"nodejs|mongosh","version":"6.5.0|2.2.5"},"devtoolsConnectVersion":"2.6.0","host":"127.0.0.1:27017"}} +{"t":{"$date":"2024-04-26T04:49:37.295Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000035,"ctx":"mongosh-connect","msg":"Server heartbeat succeeded","attr":{"connectionId":"127.0.0.1:27017"}} +{"t":{"$date":"2024-04-26T04:49:37.555Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000037,"ctx":"mongosh-connect","msg":"Connection attempt finished"} diff --git a/data/.mongodb/mongosh/config b/data/.mongodb/mongosh/config new file mode 100644 index 0000000..5066c9b --- /dev/null +++ b/data/.mongodb/mongosh/config @@ -0,0 +1 @@ +{"userId":"662b3261fb0e9fa0142202d6","telemetryAnonymousId":"662b3261fb0e9fa0142202d6","enableTelemetry":true} \ No newline at end of file diff --git a/data/.mongodb/mongosh/mongosh_repl_history b/data/.mongodb/mongosh/mongosh_repl_history new file mode 100644 index 0000000..e69de29 diff --git a/data/.mongodb/mongosh/snippets/package.json b/data/.mongodb/mongosh/snippets/package.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/data/.mongodb/mongosh/snippets/package.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/data/WiredTiger b/data/WiredTiger new file mode 100644 index 0000000..1bc57ba --- /dev/null +++ b/data/WiredTiger @@ -0,0 +1,2 @@ +WiredTiger +WiredTiger 11.2.0: (November 10, 2022) diff --git a/data/WiredTiger.lock b/data/WiredTiger.lock new file mode 100644 index 0000000..3d84206 --- /dev/null +++ b/data/WiredTiger.lock @@ -0,0 +1 @@ +WiredTiger lock file diff --git a/data/WiredTiger.turtle b/data/WiredTiger.turtle new file mode 100644 index 0000000..caa8150 --- /dev/null +++ b/data/WiredTiger.turtle @@ -0,0 +1,6 @@ +WiredTiger version string +WiredTiger 11.2.0: (November 10, 2022) +WiredTiger version +major=11,minor=2,patch=0 +file:WiredTiger.wt +access_pattern_hint=none,allocation_size=4KB,app_metadata=,assert=(commit_timestamp=none,durable_timestamp=none,read_timestamp=none,write_timestamp=off),block_allocation=best,block_compressor=,cache_resident=false,checksum=on,collator=,columns=,dictionary=0,encryption=(keyid=,name=),format=btree,huffman_key=,huffman_value=,id=0,ignore_in_memory_cache_size=false,internal_item_max=0,internal_key_max=0,internal_key_truncate=true,internal_page_max=4KB,key_format=S,key_gap=10,leaf_item_max=0,leaf_key_max=0,leaf_page_max=32KB,leaf_value_max=0,log=(enabled=true),memory_page_image_max=0,memory_page_max=5MB,os_cache_dirty_max=0,os_cache_max=0,prefix_compression=false,prefix_compression_min=4,readonly=false,split_deepen_min_child=0,split_deepen_per_child=0,split_pct=90,tiered_object=false,tiered_storage=(auth_token=,bucket=,bucket_prefix=,cache_directory=,local_retention=300,name=,object_target_size=0),value_format=S,verbose=[],version=(major=1,minor=1),write_timestamp_usage=none,checkpoint=(WiredTigerCheckpoint.448=(addr="018981e4488df4fb8a81e4d676e1678b81e42d23a08c808080e3010fc0e23fc0",order=448,time=1714182272,size=28672,newest_start_durable_ts=0,oldest_start_ts=0,newest_txn=448,newest_stop_durable_ts=0,newest_stop_ts=-1,newest_stop_txn=-11,prepare=0,write_gen=1343,run_write_gen=9)),checkpoint_backup_info=,checkpoint_lsn=(2,345216) diff --git a/data/WiredTiger.wt b/data/WiredTiger.wt new file mode 100644 index 0000000..e0266a0 Binary files /dev/null and b/data/WiredTiger.wt differ diff --git a/data/WiredTigerHS.wt b/data/WiredTigerHS.wt new file mode 100644 index 0000000..3f019cb Binary files /dev/null and b/data/WiredTigerHS.wt differ diff --git a/data/_mdb_catalog.wt b/data/_mdb_catalog.wt new file mode 100644 index 0000000..a41a745 Binary files /dev/null and b/data/_mdb_catalog.wt differ diff --git a/data/collection-0--1453851225969918699.wt b/data/collection-0--1453851225969918699.wt new file mode 100644 index 0000000..0548ac9 Binary files /dev/null and b/data/collection-0--1453851225969918699.wt differ diff --git a/data/collection-2--1453851225969918699.wt b/data/collection-2--1453851225969918699.wt new file mode 100644 index 0000000..0322954 Binary files /dev/null and b/data/collection-2--1453851225969918699.wt differ diff --git a/data/collection-4--1453851225969918699.wt b/data/collection-4--1453851225969918699.wt new file mode 100644 index 0000000..3f019cb Binary files /dev/null and b/data/collection-4--1453851225969918699.wt differ diff --git a/data/collection-7--1453851225969918699.wt b/data/collection-7--1453851225969918699.wt new file mode 100644 index 0000000..eab8a11 Binary files /dev/null and b/data/collection-7--1453851225969918699.wt differ diff --git a/data/diagnostic.data/metrics.2024-04-26T04-49-37Z-00000 b/data/diagnostic.data/metrics.2024-04-26T04-49-37Z-00000 new file mode 100644 index 0000000..2cc60be Binary files /dev/null and b/data/diagnostic.data/metrics.2024-04-26T04-49-37Z-00000 differ diff --git a/data/diagnostic.data/metrics.2024-04-26T04-49-42Z-00000 b/data/diagnostic.data/metrics.2024-04-26T04-49-42Z-00000 new file mode 100644 index 0000000..f45a7e4 Binary files /dev/null and b/data/diagnostic.data/metrics.2024-04-26T04-49-42Z-00000 differ diff --git a/data/diagnostic.data/metrics.interim b/data/diagnostic.data/metrics.interim new file mode 100644 index 0000000..c9e59a8 Binary files /dev/null and b/data/diagnostic.data/metrics.interim differ diff --git a/data/index-1--1453851225969918699.wt b/data/index-1--1453851225969918699.wt new file mode 100644 index 0000000..12e09de Binary files /dev/null and b/data/index-1--1453851225969918699.wt differ diff --git a/data/index-3--1453851225969918699.wt b/data/index-3--1453851225969918699.wt new file mode 100644 index 0000000..d9c1473 Binary files /dev/null and b/data/index-3--1453851225969918699.wt differ diff --git a/data/index-5--1453851225969918699.wt b/data/index-5--1453851225969918699.wt new file mode 100644 index 0000000..3f019cb Binary files /dev/null and b/data/index-5--1453851225969918699.wt differ diff --git a/data/index-6--1453851225969918699.wt b/data/index-6--1453851225969918699.wt new file mode 100644 index 0000000..3f019cb Binary files /dev/null and b/data/index-6--1453851225969918699.wt differ diff --git a/data/index-8--1453851225969918699.wt b/data/index-8--1453851225969918699.wt new file mode 100644 index 0000000..525c506 Binary files /dev/null and b/data/index-8--1453851225969918699.wt differ diff --git a/data/index-9--1453851225969918699.wt b/data/index-9--1453851225969918699.wt new file mode 100644 index 0000000..3764c62 Binary files /dev/null and b/data/index-9--1453851225969918699.wt differ diff --git a/data/journal/WiredTigerLog.0000000002 b/data/journal/WiredTigerLog.0000000002 new file mode 100644 index 0000000..810a534 Binary files /dev/null and b/data/journal/WiredTigerLog.0000000002 differ diff --git a/data/journal/WiredTigerPreplog.0000000001 b/data/journal/WiredTigerPreplog.0000000001 new file mode 100644 index 0000000..aa52a21 Binary files /dev/null and b/data/journal/WiredTigerPreplog.0000000001 differ diff --git a/data/journal/WiredTigerPreplog.0000000002 b/data/journal/WiredTigerPreplog.0000000002 new file mode 100644 index 0000000..aa52a21 Binary files /dev/null and b/data/journal/WiredTigerPreplog.0000000002 differ diff --git a/data/mongod.lock b/data/mongod.lock new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/data/mongod.lock @@ -0,0 +1 @@ +1 diff --git a/data/sizeStorer.wt b/data/sizeStorer.wt new file mode 100644 index 0000000..d645982 Binary files /dev/null and b/data/sizeStorer.wt differ diff --git a/data/storage.bson b/data/storage.bson new file mode 100644 index 0000000..276b694 Binary files /dev/null and b/data/storage.bson differ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5174715 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,14 @@ +blinker==1.8.1 +click==8.1.7 +dnspython==2.6.1 +Flask==3.0.3 +iniconfig==2.0.0 +itsdangerous==2.2.0 +Jinja2==3.1.3 +MarkupSafe==2.1.5 +packaging==24.0 +pluggy==1.5.0 +pymongo==4.7.0 +pytest==8.2.0 +python-dotenv==1.0.1 +Werkzeug==3.0.2 diff --git a/src/app.py b/src/app.py index ed59cb4..0a7357f 100644 --- a/src/app.py +++ b/src/app.py @@ -28,12 +28,12 @@ # if using Atlas database uncomment next line!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! and comment out the next four lines client = pymongo.MongoClient(os.getenv("MONGO_URI")) - -# if using containerized instance of mongo uncomment next 4 lines else comment them out -# root_username = os.environ["MONGO_INITDB_ROOT_USERNAME"] #1 -# root_password = os.environ["MONGO_INITDB_ROOT_PASSWORD"] #2 -# uri = f"mongodb://{root_username}:{root_password}@mongodb:27017/db?authSource=admin" #3 -# client = pymongo.MongoClient(uri) #4 + +#if using containerized instance of mongo uncomment next 4 lines else comment them out +#root_username = os.environ["MONGO_INITDB_ROOT_USERNAME"] #1 +#root_password = os.environ["MONGO_INITDB_ROOT_PASSWORD"] #2 +#uri = f"mongodb://{root_username}:{root_password}@mongodb:27017/db?authSource=admin" #3 +#client = pymongo.MongoClient(uri) #4 db = client[os.getenv("MONGO_DBNAME")] # store a reference to the database @@ -506,7 +506,6 @@ def friends(): def unauthorized_handler(): return redirect(url_for("log_in")) - # run the app if __name__ == "__main__": # use the PORT environment variable, or default to 5000 diff --git a/src/test_app.py b/src/test_app.py new file mode 100644 index 0000000..6e16a47 --- /dev/null +++ b/src/test_app.py @@ -0,0 +1,135 @@ +import pytest +from app import app, db + +import datetime +from bson.objectid import ObjectId +from bson.decimal128 import Decimal128 + +TEST_USER_POST = {'fusername': 'marc3', 'fpassword': 'password'} +TEST_INCORRECT_POST = {'fusername': 'marc3', 'fpassword': 'assword'} +TEST_USER_MONGO = {'username': 'marc3'} +db.users.delete_one(TEST_USER_MONGO) + +TEST_ITEM_POST = {'itemname': '5555', 'description': '5555', 'price': '555', 'url': '555'} +TEST_ITEM_MONGO = {'name': '5555', 'description': '5555', 'username': 'marc1', 'image_url': '555', 'price': Decimal128('555')} +#db.items.delete_one(TEST_ITEM_MONGO) + +@pytest.fixture +def client(): + app.config.update({"TESTING": True}) + + with app.test_client() as client: + yield client + +@pytest.fixture +def user(client): + client.post('/signup', data = TEST_USER_POST) + +@pytest.fixture +def login(client, user): + client.post('/login', data = TEST_USER_POST) + +def test_homepage(client): + response = client.get("/") + assert response.status_code == 200 + +#create a user and attempt to create the same user again +def test_user_already_exists(client, user): + res = client.post('/signup', data = TEST_USER_POST) + assert 'Username already in use.' in str(res.data) + +#login with wrong username and test that an error message is returned +def test_incorrect_login(client, user): + res = client.post('/login', data = TEST_INCORRECT_POST) + assert "Username or password is invalid." in str(res.data) + +#make user post an item to a page and check to see that that item is on the page +def test_user_add_item(client, user): + client.post('/add') + +#test to see +def test_index_page__not_logged_in(client): + res = client.get('/add') + assert res.status_code == 302 + +def test_index_page__logged_in(client, user): + client.post('/login', data = TEST_USER_POST) + res = client.get('/add') + assert res.status_code == 200 + +def test_home(client): + res = client.get('/') + assert res.status_code == 200 + +def test_logout(): + client.post('/logout',) + assert 1 == 1 + +def test_item(): + res = client.get('/item') + assert res.status_code == 200 + +def test_add(): + response = client.get('/add') + assert response.status_code == 200 + +def test_create_item(client, user, login): + client.post('/add/', data = TEST_ITEM_POST) + res = client.get('/add') + assert 1 == 1 + +def test_delete(client, user, login): + client.post("/delete/", data = TEST_ITEM_POST) + res = client.get('/delete') + assert res.status_code == 200 + +def test_delete_offer(client): + response = client.get('/') + +def test_edit(client): + response = client.get('/') + +def test_update_item(client): + response = client.get('/') + +def test_view_listings(client): + response = client.get('/') + +def test_set_public(client): + response = client.get('/') + +def test_set_private(client): + response = client.get("/setprivate/") + assert response.status_code == 200 + +def test_offer(client): + response = client.get('/') + assert response.status_code == 200 + +def test_view_offer(client): + response = client.get('') + assert response.status_code == 200 + +def test_sent_offers(client): + response = client.get('/') + assert response.status_code == 200 + +def test_recieved_offers(client): + response = client.get('/') + assert response.status_code == 200 + +def test_accepts_offers(client): + response = client.get('/') + assert response.status_code == 200 + +def test_reject_offer(client): + response = client.get('/') + assert response.status_code == 200 + +def test_unauthorized_handler(client): + response = client.get('/') + assert response.status_code == 200 + +db.users.delete_one(TEST_USER_MONGO) +#db.items.delete_one(TEST_ITEM_MONGO) +pytest.main() \ No newline at end of file