From 8b9384b807d8d4a4daf23da25634dbedb0734818 Mon Sep 17 00:00:00 2001 From: Dev Mukherjee Date: Mon, 18 Dec 2023 15:12:58 +1100 Subject: [PATCH 1/4] chore: update packages --- poetry.lock | 132 ++++++++++++++++++++++++++++--------------------- pyproject.toml | 5 +- 2 files changed, 78 insertions(+), 59 deletions(-) diff --git a/poetry.lock b/poetry.lock index e466bd21..0cfda622 100644 --- a/poetry.lock +++ b/poetry.lock @@ -13,13 +13,13 @@ files = [ [[package]] name = "anyio" -version = "4.1.0" +version = "4.2.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false python-versions = ">=3.8" files = [ - {file = "anyio-4.1.0-py3-none-any.whl", hash = "sha256:56a415fbc462291813a94528a779597226619c8e78af7de0507333f700011e5f"}, - {file = "anyio-4.1.0.tar.gz", hash = "sha256:5a0bec7085176715be77df87fc66d6c9d70626bd752fcc85f57cdbee5b3760da"}, + {file = "anyio-4.2.0-py3-none-any.whl", hash = "sha256:745843b39e829e108e518c489b31dc757de7d2131d53fac32bd8df268227bfee"}, + {file = "anyio-4.2.0.tar.gz", hash = "sha256:e1875bb4b4e2de1669f4bc7869b6d3f54231cdced71605e6e64c9be77e3be50f"}, ] [package.dependencies] @@ -69,63 +69,63 @@ files = [ [[package]] name = "coverage" -version = "7.3.2" +version = "7.3.3" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.8" files = [ - {file = "coverage-7.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d872145f3a3231a5f20fd48500274d7df222e291d90baa2026cc5152b7ce86bf"}, - {file = "coverage-7.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:310b3bb9c91ea66d59c53fa4989f57d2436e08f18fb2f421a1b0b6b8cc7fffda"}, - {file = "coverage-7.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f47d39359e2c3779c5331fc740cf4bce6d9d680a7b4b4ead97056a0ae07cb49a"}, - {file = "coverage-7.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:aa72dbaf2c2068404b9870d93436e6d23addd8bbe9295f49cbca83f6e278179c"}, - {file = "coverage-7.3.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:beaa5c1b4777f03fc63dfd2a6bd820f73f036bfb10e925fce067b00a340d0f3f"}, - {file = "coverage-7.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:dbc1b46b92186cc8074fee9d9fbb97a9dd06c6cbbef391c2f59d80eabdf0faa6"}, - {file = "coverage-7.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:315a989e861031334d7bee1f9113c8770472db2ac484e5b8c3173428360a9148"}, - {file = "coverage-7.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d1bc430677773397f64a5c88cb522ea43175ff16f8bfcc89d467d974cb2274f9"}, - {file = "coverage-7.3.2-cp310-cp310-win32.whl", hash = "sha256:a889ae02f43aa45032afe364c8ae84ad3c54828c2faa44f3bfcafecb5c96b02f"}, - {file = "coverage-7.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:c0ba320de3fb8c6ec16e0be17ee1d3d69adcda99406c43c0409cb5c41788a611"}, - {file = "coverage-7.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ac8c802fa29843a72d32ec56d0ca792ad15a302b28ca6203389afe21f8fa062c"}, - {file = "coverage-7.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:89a937174104339e3a3ffcf9f446c00e3a806c28b1841c63edb2b369310fd074"}, - {file = "coverage-7.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e267e9e2b574a176ddb983399dec325a80dbe161f1a32715c780b5d14b5f583a"}, - {file = "coverage-7.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2443cbda35df0d35dcfb9bf8f3c02c57c1d6111169e3c85fc1fcc05e0c9f39a3"}, - {file = "coverage-7.3.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4175e10cc8dda0265653e8714b3174430b07c1dca8957f4966cbd6c2b1b8065a"}, - {file = "coverage-7.3.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0cbf38419fb1a347aaf63481c00f0bdc86889d9fbf3f25109cf96c26b403fda1"}, - {file = "coverage-7.3.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:5c913b556a116b8d5f6ef834038ba983834d887d82187c8f73dec21049abd65c"}, - {file = "coverage-7.3.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1981f785239e4e39e6444c63a98da3a1db8e971cb9ceb50a945ba6296b43f312"}, - {file = "coverage-7.3.2-cp311-cp311-win32.whl", hash = "sha256:43668cabd5ca8258f5954f27a3aaf78757e6acf13c17604d89648ecc0cc66640"}, - {file = "coverage-7.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:e10c39c0452bf6e694511c901426d6b5ac005acc0f78ff265dbe36bf81f808a2"}, - {file = "coverage-7.3.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:4cbae1051ab791debecc4a5dcc4a1ff45fc27b91b9aee165c8a27514dd160836"}, - {file = "coverage-7.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:12d15ab5833a997716d76f2ac1e4b4d536814fc213c85ca72756c19e5a6b3d63"}, - {file = "coverage-7.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c7bba973ebee5e56fe9251300c00f1579652587a9f4a5ed8404b15a0471f216"}, - {file = "coverage-7.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fe494faa90ce6381770746077243231e0b83ff3f17069d748f645617cefe19d4"}, - {file = "coverage-7.3.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f6e9589bd04d0461a417562649522575d8752904d35c12907d8c9dfeba588faf"}, - {file = "coverage-7.3.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:d51ac2a26f71da1b57f2dc81d0e108b6ab177e7d30e774db90675467c847bbdf"}, - {file = "coverage-7.3.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:99b89d9f76070237975b315b3d5f4d6956ae354a4c92ac2388a5695516e47c84"}, - {file = "coverage-7.3.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:fa28e909776dc69efb6ed975a63691bc8172b64ff357e663a1bb06ff3c9b589a"}, - {file = "coverage-7.3.2-cp312-cp312-win32.whl", hash = "sha256:289fe43bf45a575e3ab10b26d7b6f2ddb9ee2dba447499f5401cfb5ecb8196bb"}, - {file = "coverage-7.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:7dbc3ed60e8659bc59b6b304b43ff9c3ed858da2839c78b804973f613d3e92ed"}, - {file = "coverage-7.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f94b734214ea6a36fe16e96a70d941af80ff3bfd716c141300d95ebc85339738"}, - {file = "coverage-7.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:af3d828d2c1cbae52d34bdbb22fcd94d1ce715d95f1a012354a75e5913f1bda2"}, - {file = "coverage-7.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:630b13e3036e13c7adc480ca42fa7afc2a5d938081d28e20903cf7fd687872e2"}, - {file = "coverage-7.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c9eacf273e885b02a0273bb3a2170f30e2d53a6d53b72dbe02d6701b5296101c"}, - {file = "coverage-7.3.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d8f17966e861ff97305e0801134e69db33b143bbfb36436efb9cfff6ec7b2fd9"}, - {file = "coverage-7.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:b4275802d16882cf9c8b3d057a0839acb07ee9379fa2749eca54efbce1535b82"}, - {file = "coverage-7.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:72c0cfa5250f483181e677ebc97133ea1ab3eb68645e494775deb6a7f6f83901"}, - {file = "coverage-7.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:cb536f0dcd14149425996821a168f6e269d7dcd2c273a8bff8201e79f5104e76"}, - {file = "coverage-7.3.2-cp38-cp38-win32.whl", hash = "sha256:307adb8bd3abe389a471e649038a71b4eb13bfd6b7dd9a129fa856f5c695cf92"}, - {file = "coverage-7.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:88ed2c30a49ea81ea3b7f172e0269c182a44c236eb394718f976239892c0a27a"}, - {file = "coverage-7.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b631c92dfe601adf8f5ebc7fc13ced6bb6e9609b19d9a8cd59fa47c4186ad1ce"}, - {file = "coverage-7.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:d3d9df4051c4a7d13036524b66ecf7a7537d14c18a384043f30a303b146164e9"}, - {file = "coverage-7.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5f7363d3b6a1119ef05015959ca24a9afc0ea8a02c687fe7e2d557705375c01f"}, - {file = "coverage-7.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2f11cc3c967a09d3695d2a6f03fb3e6236622b93be7a4b5dc09166a861be6d25"}, - {file = "coverage-7.3.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:149de1d2401ae4655c436a3dced6dd153f4c3309f599c3d4bd97ab172eaf02d9"}, - {file = "coverage-7.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:3a4006916aa6fee7cd38db3bfc95aa9c54ebb4ffbfc47c677c8bba949ceba0a6"}, - {file = "coverage-7.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9028a3871280110d6e1aa2df1afd5ef003bab5fb1ef421d6dc748ae1c8ef2ebc"}, - {file = "coverage-7.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9f805d62aec8eb92bab5b61c0f07329275b6f41c97d80e847b03eb894f38d083"}, - {file = "coverage-7.3.2-cp39-cp39-win32.whl", hash = "sha256:d1c88ec1a7ff4ebca0219f5b1ef863451d828cccf889c173e1253aa84b1e07ce"}, - {file = "coverage-7.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:b4767da59464bb593c07afceaddea61b154136300881844768037fd5e859353f"}, - {file = "coverage-7.3.2-pp38.pp39.pp310-none-any.whl", hash = "sha256:ae97af89f0fbf373400970c0a21eef5aa941ffeed90aee43650b81f7d7f47637"}, - {file = "coverage-7.3.2.tar.gz", hash = "sha256:be32ad29341b0170e795ca590e1c07e81fc061cb5b10c74ce7203491484404ef"}, + {file = "coverage-7.3.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d874434e0cb7b90f7af2b6e3309b0733cde8ec1476eb47db148ed7deeb2a9494"}, + {file = "coverage-7.3.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ee6621dccce8af666b8c4651f9f43467bfbf409607c604b840b78f4ff3619aeb"}, + {file = "coverage-7.3.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1367aa411afb4431ab58fd7ee102adb2665894d047c490649e86219327183134"}, + {file = "coverage-7.3.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1f0f8f0c497eb9c9f18f21de0750c8d8b4b9c7000b43996a094290b59d0e7523"}, + {file = "coverage-7.3.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db0338c4b0951d93d547e0ff8d8ea340fecf5885f5b00b23be5aa99549e14cfd"}, + {file = "coverage-7.3.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d31650d313bd90d027f4be7663dfa2241079edd780b56ac416b56eebe0a21aab"}, + {file = "coverage-7.3.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:9437a4074b43c177c92c96d051957592afd85ba00d3e92002c8ef45ee75df438"}, + {file = "coverage-7.3.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:9e17d9cb06c13b4f2ef570355fa45797d10f19ca71395910b249e3f77942a837"}, + {file = "coverage-7.3.3-cp310-cp310-win32.whl", hash = "sha256:eee5e741b43ea1b49d98ab6e40f7e299e97715af2488d1c77a90de4a663a86e2"}, + {file = "coverage-7.3.3-cp310-cp310-win_amd64.whl", hash = "sha256:593efa42160c15c59ee9b66c5f27a453ed3968718e6e58431cdfb2d50d5ad284"}, + {file = "coverage-7.3.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8c944cf1775235c0857829c275c777a2c3e33032e544bcef614036f337ac37bb"}, + {file = "coverage-7.3.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:eda7f6e92358ac9e1717ce1f0377ed2b9320cea070906ece4e5c11d172a45a39"}, + {file = "coverage-7.3.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c854c1d2c7d3e47f7120b560d1a30c1ca221e207439608d27bc4d08fd4aeae8"}, + {file = "coverage-7.3.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:222b038f08a7ebed1e4e78ccf3c09a1ca4ac3da16de983e66520973443b546bc"}, + {file = "coverage-7.3.3-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ff4800783d85bff132f2cc7d007426ec698cdce08c3062c8d501ad3f4ea3d16c"}, + {file = "coverage-7.3.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:fc200cec654311ca2c3f5ab3ce2220521b3d4732f68e1b1e79bef8fcfc1f2b97"}, + {file = "coverage-7.3.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:307aecb65bb77cbfebf2eb6e12009e9034d050c6c69d8a5f3f737b329f4f15fb"}, + {file = "coverage-7.3.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:ffb0eacbadb705c0a6969b0adf468f126b064f3362411df95f6d4f31c40d31c1"}, + {file = "coverage-7.3.3-cp311-cp311-win32.whl", hash = "sha256:79c32f875fd7c0ed8d642b221cf81feba98183d2ff14d1f37a1bbce6b0347d9f"}, + {file = "coverage-7.3.3-cp311-cp311-win_amd64.whl", hash = "sha256:243576944f7c1a1205e5cd658533a50eba662c74f9be4c050d51c69bd4532936"}, + {file = "coverage-7.3.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:a2ac4245f18057dfec3b0074c4eb366953bca6787f1ec397c004c78176a23d56"}, + {file = "coverage-7.3.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f9191be7af41f0b54324ded600e8ddbcabea23e1e8ba419d9a53b241dece821d"}, + {file = "coverage-7.3.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:31c0b1b8b5a4aebf8fcd227237fc4263aa7fa0ddcd4d288d42f50eff18b0bac4"}, + {file = "coverage-7.3.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ee453085279df1bac0996bc97004771a4a052b1f1e23f6101213e3796ff3cb85"}, + {file = "coverage-7.3.3-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1191270b06ecd68b1d00897b2daddb98e1719f63750969614ceb3438228c088e"}, + {file = "coverage-7.3.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:007a7e49831cfe387473e92e9ff07377f6121120669ddc39674e7244350a6a29"}, + {file = "coverage-7.3.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:af75cf83c2d57717a8493ed2246d34b1f3398cb8a92b10fd7a1858cad8e78f59"}, + {file = "coverage-7.3.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:811ca7373da32f1ccee2927dc27dc523462fd30674a80102f86c6753d6681bc6"}, + {file = "coverage-7.3.3-cp312-cp312-win32.whl", hash = "sha256:733537a182b5d62184f2a72796eb6901299898231a8e4f84c858c68684b25a70"}, + {file = "coverage-7.3.3-cp312-cp312-win_amd64.whl", hash = "sha256:e995efb191f04b01ced307dbd7407ebf6e6dc209b528d75583277b10fd1800ee"}, + {file = "coverage-7.3.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:fbd8a5fe6c893de21a3c6835071ec116d79334fbdf641743332e442a3466f7ea"}, + {file = "coverage-7.3.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:50c472c1916540f8b2deef10cdc736cd2b3d1464d3945e4da0333862270dcb15"}, + {file = "coverage-7.3.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e9223a18f51d00d3ce239c39fc41410489ec7a248a84fab443fbb39c943616c"}, + {file = "coverage-7.3.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f501e36ac428c1b334c41e196ff6bd550c0353c7314716e80055b1f0a32ba394"}, + {file = "coverage-7.3.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:475de8213ed95a6b6283056d180b2442eee38d5948d735cd3d3b52b86dd65b92"}, + {file = "coverage-7.3.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:afdcc10c01d0db217fc0a64f58c7edd635b8f27787fea0a3054b856a6dff8717"}, + {file = "coverage-7.3.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:fff0b2f249ac642fd735f009b8363c2b46cf406d3caec00e4deeb79b5ff39b40"}, + {file = "coverage-7.3.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:a1f76cfc122c9e0f62dbe0460ec9cc7696fc9a0293931a33b8870f78cf83a327"}, + {file = "coverage-7.3.3-cp38-cp38-win32.whl", hash = "sha256:757453848c18d7ab5d5b5f1827293d580f156f1c2c8cef45bfc21f37d8681069"}, + {file = "coverage-7.3.3-cp38-cp38-win_amd64.whl", hash = "sha256:ad2453b852a1316c8a103c9c970db8fbc262f4f6b930aa6c606df9b2766eee06"}, + {file = "coverage-7.3.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3b15e03b8ee6a908db48eccf4e4e42397f146ab1e91c6324da44197a45cb9132"}, + {file = "coverage-7.3.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:89400aa1752e09f666cc48708eaa171eef0ebe3d5f74044b614729231763ae69"}, + {file = "coverage-7.3.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c59a3e59fb95e6d72e71dc915e6d7fa568863fad0a80b33bc7b82d6e9f844973"}, + {file = "coverage-7.3.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9ede881c7618f9cf93e2df0421ee127afdfd267d1b5d0c59bcea771cf160ea4a"}, + {file = "coverage-7.3.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f3bfd2c2f0e5384276e12b14882bf2c7621f97c35320c3e7132c156ce18436a1"}, + {file = "coverage-7.3.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:7f3bad1a9313401ff2964e411ab7d57fb700a2d5478b727e13f156c8f89774a0"}, + {file = "coverage-7.3.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:65d716b736f16e250435473c5ca01285d73c29f20097decdbb12571d5dfb2c94"}, + {file = "coverage-7.3.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a702e66483b1fe602717020a0e90506e759c84a71dbc1616dd55d29d86a9b91f"}, + {file = "coverage-7.3.3-cp39-cp39-win32.whl", hash = "sha256:7fbf3f5756e7955174a31fb579307d69ffca91ad163467ed123858ce0f3fd4aa"}, + {file = "coverage-7.3.3-cp39-cp39-win_amd64.whl", hash = "sha256:cad9afc1644b979211989ec3ff7d82110b2ed52995c2f7263e7841c846a75348"}, + {file = "coverage-7.3.3-pp38.pp39.pp310-none-any.whl", hash = "sha256:d299d379b676812e142fb57662a8d0d810b859421412b4d7af996154c00c31bb"}, + {file = "coverage-7.3.3.tar.gz", hash = "sha256:df04c64e58df96b4427db8d0559e95e2df3138c9916c96f9f6a4dd220db2fdb7"}, ] [package.extras] @@ -441,6 +441,24 @@ pluggy = ">=0.12,<2.0" [package.extras] testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] +[[package]] +name = "pytest-asyncio" +version = "0.23.2" +description = "Pytest support for asyncio" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest-asyncio-0.23.2.tar.gz", hash = "sha256:c16052382554c7b22d48782ab3438d5b10f8cf7a4bdcae7f0f67f097d95beecc"}, + {file = "pytest_asyncio-0.23.2-py3-none-any.whl", hash = "sha256:ea9021364e32d58f0be43b91c6233fb8d2224ccef2398d6837559e587682808f"}, +] + +[package.dependencies] +pytest = ">=7.0.0" + +[package.extras] +docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] +testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"] + [[package]] name = "pytest-cov" version = "4.1.0" @@ -537,4 +555,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "b306cf2dff8f61532978a697b696f78f80317e46f5cbd385c1913afed607b691" +content-hash = "ea1f66b0ea5936b9d5d1a0e6e6389a1382a502720f756d7ed34b6f7350b3afa0" diff --git a/pyproject.toml b/pyproject.toml index 7baa44ab..17292343 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,10 +21,10 @@ python = "^3.11" httpx = "^0.25.2" pydantic = "^2.5.2" typing-extensions = "^4.9.0" -coverage = "^7.3.2" +coverage = "^7.3.3" pytest = "^7.4.3" pytest-order = "^1.2.0" -anyio = "^4.1.0" +anyio = "^4.2.0" annotated-types = "^0.6.0" certifi = "^2023.11.17" idna = "^3.6" @@ -32,6 +32,7 @@ packaging = "^23.2" pluggy = "^1.3.0" typer = "^0.9.0" rich = "^13.7.0" +pytest-asyncio = "^0.23.2" [tool.poetry.group.dev.dependencies] pytest = "^7.2.2" From cc73e4e0590728836735334aac3ba1abde4ccd01 Mon Sep 17 00:00:00 2001 From: Dev Mukherjee Date: Mon, 18 Dec 2023 15:57:35 +1100 Subject: [PATCH 2/4] chore: move to concurrency this is our attempt to move to concurrency before the library goes out of hand there are a few exception at the moment around typer not being able to support async/await we can work around that when they support it https://github.com/anomaly/gallagher/issues/18 --- gallagher/cc/alarms/__init__.py | 2 +- gallagher/cc/alarms/day_category.py | 2 +- gallagher/cc/alarms/divisions.py | 2 +- gallagher/cc/alarms/events.py | 4 +- gallagher/cc/alarms/items.py | 4 +- gallagher/cc/alarms/schedule.py | 2 +- gallagher/cc/cardholders/card_type.py | 2 +- gallagher/cc/cardholders/cardholders.py | 4 +- gallagher/cc/core.py | 156 +++++++++++++----------- gallagher/cli/cardholders.py | 4 +- gallagher/dto/cardholder.py | 2 +- gallagher/dto/discover.py | 2 +- gallagher/dto/event.py | 4 +- pytest.ini | 2 + tests/__init__.py | 6 + 15 files changed, 110 insertions(+), 88 deletions(-) create mode 100644 pytest.ini diff --git a/gallagher/cc/alarms/__init__.py b/gallagher/cc/alarms/__init__.py index 64af6fd6..943de9b2 100644 --- a/gallagher/cc/alarms/__init__.py +++ b/gallagher/cc/alarms/__init__.py @@ -22,7 +22,7 @@ class Alarms( """ @classmethod - def get_config(cls): + async def get_config(cls): return EndpointConfig( endpoint=Capabilities.CURRENT.features.alarms.alarms, dto_list=AlarmResponse, diff --git a/gallagher/cc/alarms/day_category.py b/gallagher/cc/alarms/day_category.py index f908665e..ca9112f8 100644 --- a/gallagher/cc/alarms/day_category.py +++ b/gallagher/cc/alarms/day_category.py @@ -19,7 +19,7 @@ class DayCategory(APIEndpoint): """ @classmethod - def get_config(cls): + async def get_config(cls): return EndpointConfig( endpoint=Capabilities.CURRENT.features.day_categories .day_categories, diff --git a/gallagher/cc/alarms/divisions.py b/gallagher/cc/alarms/divisions.py index bb9990ae..383e4838 100644 --- a/gallagher/cc/alarms/divisions.py +++ b/gallagher/cc/alarms/divisions.py @@ -23,7 +23,7 @@ class Division(APIEndpoint): """ @classmethod - def get_config(cls): + async def get_config(cls): return EndpointConfig( endpoint=Capabilities.CURRENT.features.divisions.divisions, dto_list=DivisionDetailResponse, diff --git a/gallagher/cc/alarms/events.py b/gallagher/cc/alarms/events.py index 7a5bab56..4b843d21 100644 --- a/gallagher/cc/alarms/events.py +++ b/gallagher/cc/alarms/events.py @@ -23,7 +23,7 @@ class Event( """ @classmethod - def get_config(cls): + async def get_config(cls): return EndpointConfig( endpoint=Capabilities.CURRENT.features.events.events, dto_list=EventResponse, @@ -39,7 +39,7 @@ class EventType( """ @classmethod - def get_config(cls): + async def get_config(cls): return EndpointConfig( endpoint=Capabilities.CURRENT.features.events.event_groups, dto_list=EventTypeResponse, diff --git a/gallagher/cc/alarms/items.py b/gallagher/cc/alarms/items.py index 8d06d1fb..b5aa226d 100644 --- a/gallagher/cc/alarms/items.py +++ b/gallagher/cc/alarms/items.py @@ -22,7 +22,7 @@ class ItemsTypes(APIEndpoint): """ @classmethod - def get_config(cls): + async def get_config(cls): return EndpointConfig( endpoint=Capabilities.CURRENT.features.items.item_types, dto_list=ItemTypesResponse, @@ -39,7 +39,7 @@ class Item(APIEndpoint): """ @classmethod - def get_config(cls): + async def get_config(cls): return EndpointConfig( endpoint=Capabilities.CURRENT.features.items.items, dto_list=ItemsSummaryResponse, diff --git a/gallagher/cc/alarms/schedule.py b/gallagher/cc/alarms/schedule.py index 38095ef7..77c8f3bb 100644 --- a/gallagher/cc/alarms/schedule.py +++ b/gallagher/cc/alarms/schedule.py @@ -18,7 +18,7 @@ class Schedule(APIEndpoint): """ @classmethod - def get_config(cls): + async def get_config(cls): return EndpointConfig( endpoint=Capabilities.CURRENT.features.schedules.schedules, dto_list=ScheduleSummaryResponse, diff --git a/gallagher/cc/cardholders/card_type.py b/gallagher/cc/cardholders/card_type.py index 722dded0..d523b778 100644 --- a/gallagher/cc/cardholders/card_type.py +++ b/gallagher/cc/cardholders/card_type.py @@ -21,7 +21,7 @@ class CardType(APIEndpoint): """ @classmethod - def get_config(cls): + async def get_config(cls): return EndpointConfig( endpoint=Capabilities.CURRENT.features.card_types.card_types, dto_list=CardTypeResponse, diff --git a/gallagher/cc/cardholders/cardholders.py b/gallagher/cc/cardholders/cardholders.py index 0f97fedb..9341d1dc 100644 --- a/gallagher/cc/cardholders/cardholders.py +++ b/gallagher/cc/cardholders/cardholders.py @@ -22,7 +22,7 @@ class Cardholder(APIEndpoint): """ @classmethod - def get_config(cls): + async def get_config(cls): return EndpointConfig( endpoint=Capabilities.CURRENT.features.cardholders.cardholders, dto_list=CardholderSummaryResponse, @@ -30,5 +30,5 @@ def get_config(cls): ) @classmethod - def search(cls, name: str, sort: str = "id", top: int = 100): + async def search(cls, name: str, sort: str = "id", top: int = 100): pass diff --git a/gallagher/cc/core.py b/gallagher/cc/core.py index f2ea3ce7..c3387da9 100644 --- a/gallagher/cc/core.py +++ b/gallagher/cc/core.py @@ -27,7 +27,7 @@ ) -def check_api_key_format(api_key): +async def check_api_key_format(api_key): """ Validates that the Gallagher Key is in the right format. It's not possible for the API client to validate the key against @@ -38,7 +38,7 @@ def check_api_key_format(api_key): return (api_tokens.count() == 8) -def get_authorization_headers(): +async def get_authorization_headers(): """ Creates an authorization header for Gallagher API calls The server expects an Authorization header with GGL-API-KEY @@ -88,7 +88,7 @@ class EndpointConfig: # fields: list[str] = [] # Optional list of fields @classmethod - def validate_endpoint(cls): + async def validate_endpoint(cls): """ Check to see if the feature is licensed and available Gallagher REST API is licensed per feature, if a feature is not @@ -120,6 +120,13 @@ class Capabilities: ) +# Async client for making requests to the Gallagher API +# see documentation where httpx suggests we use the same +# object across requests +# https://www.python-httpx.org/async/#opening-and-closing-clients +_httpx_async = httpx.AsyncClient() + + class APIEndpoint: """ Base class for all API objects @@ -136,7 +143,7 @@ class APIEndpoint: __config__ = None @classmethod - def get_config(cls): + async def get_config(cls): """ Returns the configuration for the endpoint This method can be overridden by the child class to @@ -145,7 +152,7 @@ def get_config(cls): return None @classmethod - def _discover(cls): + async def _discover(cls): """ The Command Centre root API endpoint Much of Gallagher's API documentation suggests that we don't @@ -175,103 +182,108 @@ def _discover(cls): # Auto-discovery of the API endpoints, this will # be called as part of the bootstrapping process from . import api_base - response = httpx.get( - api_base, - headers=get_authorization_headers(), - ) - - parsed_obj = DiscoveryResponse.model_validate( - response.json() - ) - - # Assign the capabilities to the class, this should - # result in the endpoint - # - # With the refactored initialisation of the pydantic - # models, the values for the unavailable endpoints - # should be set to None - Capabilities.CURRENT = parsed_obj - - # Set this so the configuration is only discovered - # once per endpoint - # - # If we assign the __config__ variable in the class - # that inherits from this class, the instance of EndpointConfig - # will copy the None values from the Capabilities.CURRENT - # object, this primarily because Capabilities.CURRENT is - # an instance of a pyndatic object and all values are thus - # copied not referenced. - cls.__config__ = cls.get_config() + async with _httpx_async: + response = await _httpx_async.get( + api_base, + headers=get_authorization_headers(), + ) + + parsed_obj = DiscoveryResponse.model_validate( + response.json() + ) + + # Assign the capabilities to the class, this should + # result in the endpoint + # + # With the refactored initialisation of the pydantic + # models, the values for the unavailable endpoints + # should be set to None + Capabilities.CURRENT = parsed_obj + + # Set this so the configuration is only discovered + # once per endpoint + # + # If we assign the __config__ variable in the class + # that inherits from this class, the instance of EndpointConfig + # will copy the None values from the Capabilities.CURRENT + # object, this primarily because Capabilities.CURRENT is + # an instance of a pyndatic object and all values are thus + # copied not referenced. + cls.__config__ = await cls.get_config() @classmethod - def list(cls, skip=0): + async def list(cls, skip=0): """ For a list of objects for the given resource Most resources can be searched which is exposed by this method. Resources also allow pagination which can be controlled by the skip """ - cls._discover() + await cls._discover() - response = httpx.get( - f'{cls.__config__.endpoint.href}', - headers=get_authorization_headers(), - ) + async with _httpx_async: + + response = await _httpx_async.get( + f'{cls.__config__.endpoint.href}', + headers=get_authorization_headers(), + ) - parsed_obj = cls.__config__.dto_list.model_validate( - response.json() - ) + parsed_obj = cls.__config__.dto_list.model_validate( + response.json() + ) - return parsed_obj + return parsed_obj @classmethod - def retrieve(cls, id): + async def retrieve(cls, id): """ Retrieve a single object for the given resource Most objects have an ID which is numeral or UUID. Each resource also provides a href and pagination for children. """ - cls._discover() + await cls._discover() - response = httpx.get( - f'{cls.__config__.endpoint.href}/{id}', - headers=get_authorization_headers(), - ) + async with _httpx_async: - parsed_obj = cls.__config__.dto_retrieve.model_validate( - response.json() - ) + response = await _httpx_async.get( + f'{cls.__config__.endpoint.href}/{id}', + headers=get_authorization_headers(), + ) + + parsed_obj = cls.__config__.dto_retrieve.model_validate( + response.json() + ) - return parsed_obj + return parsed_obj @classmethod - def modify(cls): + async def modify(cls): """ """ pass @classmethod - def create(cls, **params): + async def create(cls, **params): """ """ cls._discover() @classmethod - def delete(cls): + async def delete(cls): """ """ cls._discover() @classmethod - def search(cls, - top: int = 100, - sort: str = 'id', - fields: str = 'defaults', - **kwargs - ): + async def search(cls, + top: int = 100, + sort: str = 'id', + fields: str = 'defaults', + **kwargs + ): """ Search wrapper for most objects to dynamically search content Each object has a set of fields that you can query for, most searches @@ -283,7 +295,7 @@ def search(cls, :param kwargs: Fields to search for """ - cls._discover() + await cls._discover() params = { 'top': top, @@ -295,14 +307,16 @@ def search(cls, # for each type of object that calls the base function params.update(kwargs) - response = httpx.get( - f'{cls.__config__.endpoint.href}', - params=params, - headers=get_authorization_headers(), - ) + async with _httpx_async: + + response = await _httpx_async.get( + f'{cls.__config__.endpoint.href}', + params=params, + headers=get_authorization_headers(), + ) - parsed_obj = cls.__config__.dto_list.model_validate( - response.json() - ) + parsed_obj = cls.__config__.dto_list.model_validate( + response.json() + ) - return parsed_obj + return parsed_obj diff --git a/gallagher/cli/cardholders.py b/gallagher/cli/cardholders.py index 1f1d4632..71a7a7bd 100644 --- a/gallagher/cli/cardholders.py +++ b/gallagher/cli/cardholders.py @@ -12,7 +12,7 @@ @app.command("list") -def list(): +async def list(): """ list all cardholders """ console = Console() @@ -33,7 +33,7 @@ def list(): @app.command("get") -def get(id: int): +async def get(id: int): """ get a cardholder by id """ cardholder = Cardholder.retrieve(id) diff --git a/gallagher/dto/cardholder.py b/gallagher/dto/cardholder.py index 62faf164..c61a5414 100644 --- a/gallagher/dto/cardholder.py +++ b/gallagher/dto/cardholder.py @@ -50,7 +50,7 @@ def __rich_repr__(self): "yes" if self.authorised else "no" ] - def __str__(self): + async def __str__(self): return f"{self.id} {self.first_name} {self.last_name}" diff --git a/gallagher/dto/discover.py b/gallagher/dto/discover.py index 654f4224..e3d184dc 100644 --- a/gallagher/dto/discover.py +++ b/gallagher/dto/discover.py @@ -262,7 +262,7 @@ class DiscoveryResponse( ] = FeaturesDetail() @property - def get_sem_ver(self): + async def get_sem_ver(self): """ Get a SemVer tuple from the version string """ return self.version.split(".") diff --git a/gallagher/dto/event.py b/gallagher/dto/event.py index 0c5016e2..081c78fe 100644 --- a/gallagher/dto/event.py +++ b/gallagher/dto/event.py @@ -9,7 +9,7 @@ IdentityMixin, ) -from ..dto.alarm import AlarmRef +# from ..dto.alarm import AlarmRef from ..dto.cardholder import CardholderRef from ..dto.access_group import AccessGroupRef from ..dto.door import DoorRef @@ -69,7 +69,7 @@ class EventSummaryResponse( message: Optional[str] occurrences: int priority: int - alarm: AlarmRef + # alarm: AlarmRef operator: CardholderRef source: str diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 00000000..d280de04 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +asyncio_mode = auto \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py index dc5d6ae6..2aa93935 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -3,6 +3,12 @@ Test suite for the Gallagher Python idiomatic client library, using pytest run via Taskfile. + The pytest.mark.asyncio marker can be omitted entirely in auto mode + where the asyncio marker is added automatically to async test functions. + + Refer to pytest.ini for configuration + https://pytest-asyncio.readthedocs.io/en/latest/reference/markers/index.html + """ From 86918f875c87b3334f1eed23428c565f40314920 Mon Sep 17 00:00:00 2001 From: Dev Mukherjee Date: Mon, 18 Dec 2023 16:25:28 +1100 Subject: [PATCH 3/4] fix: basic lifecycle of asyncio working moved to explicitly closing the client upon each requestREFS #18 --- gallagher/cc/core.py | 27 ++++++++++++++------------- tests/test_alarm.py | 4 ++-- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/gallagher/cc/core.py b/gallagher/cc/core.py index c3387da9..0e199a20 100644 --- a/gallagher/cc/core.py +++ b/gallagher/cc/core.py @@ -27,7 +27,7 @@ ) -async def check_api_key_format(api_key): +def check_api_key_format(api_key): """ Validates that the Gallagher Key is in the right format. It's not possible for the API client to validate the key against @@ -38,7 +38,7 @@ async def check_api_key_format(api_key): return (api_tokens.count() == 8) -async def get_authorization_headers(): +def get_authorization_headers(): """ Creates an authorization header for Gallagher API calls The server expects an Authorization header with GGL-API-KEY @@ -120,13 +120,6 @@ class Capabilities: ) -# Async client for making requests to the Gallagher API -# see documentation where httpx suggests we use the same -# object across requests -# https://www.python-httpx.org/async/#opening-and-closing-clients -_httpx_async = httpx.AsyncClient() - - class APIEndpoint: """ Base class for all API objects @@ -182,12 +175,14 @@ async def _discover(cls): # Auto-discovery of the API endpoints, this will # be called as part of the bootstrapping process from . import api_base - async with _httpx_async: + async with httpx.AsyncClient() as _httpx_async: response = await _httpx_async.get( api_base, headers=get_authorization_headers(), ) + await _httpx_async.aclose() + parsed_obj = DiscoveryResponse.model_validate( response.json() ) @@ -220,13 +215,15 @@ async def list(cls, skip=0): """ await cls._discover() - async with _httpx_async: + async with httpx.AsyncClient() as _httpx_async: response = await _httpx_async.get( f'{cls.__config__.endpoint.href}', headers=get_authorization_headers(), ) + await _httpx_async.aclose() + parsed_obj = cls.__config__.dto_list.model_validate( response.json() ) @@ -243,13 +240,15 @@ async def retrieve(cls, id): """ await cls._discover() - async with _httpx_async: + async with httpx.AsyncClient() as _httpx_async: response = await _httpx_async.get( f'{cls.__config__.endpoint.href}/{id}', headers=get_authorization_headers(), ) + await _httpx_async.aclose() + parsed_obj = cls.__config__.dto_retrieve.model_validate( response.json() ) @@ -307,7 +306,7 @@ async def search(cls, # for each type of object that calls the base function params.update(kwargs) - async with _httpx_async: + async with httpx.AsyncClient() as _httpx_async: response = await _httpx_async.get( f'{cls.__config__.endpoint.href}', @@ -315,6 +314,8 @@ async def search(cls, headers=get_authorization_headers(), ) + await _httpx_async.aclose() + parsed_obj = cls.__config__.dto_list.model_validate( response.json() ) diff --git a/tests/test_alarm.py b/tests/test_alarm.py index bf5ba187..ae84e377 100644 --- a/tests/test_alarm.py +++ b/tests/test_alarm.py @@ -4,7 +4,7 @@ """ -def test_alarms_list(): +async def test_alarms_list(): """ Get a list of item types and iterates through it these are a summary response @@ -12,7 +12,7 @@ def test_alarms_list(): from gallagher.cc.alarms import Alarms from gallagher.dto.alarm import AlarmResponse - response = Alarms.list() + response = await Alarms.list() assert type(response) is AlarmResponse assert type(response.alarms) is list assert len(response.alarms) > 0 From baaf841ef4f3950a83981c4e69989432d334c811 Mon Sep 17 00:00:00 2001 From: Dev Mukherjee Date: Mon, 18 Dec 2023 16:30:14 +1100 Subject: [PATCH 4/4] refactor: all tests are now async pending running a full test this changes all the test calls to be async, we recomend merging this branch into the dto-implementation branch and let the tests run against the server to see if the tests pass REFS #18 --- tests/__init__.py | 2 ++ tests/test_card_types.py | 4 ++-- tests/test_cardholder.py | 8 ++++---- tests/test_day_category.py | 4 ++-- tests/test_discover.py | 2 +- tests/test_divisions.py | 10 +++++----- tests/test_events.py | 4 ++-- tests/test_items.py | 14 +++++++------- tests/test_schedule.py | 4 ++-- tests/test_version.py | 2 +- 10 files changed, 28 insertions(+), 26 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index 2aa93935..243b2176 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -9,6 +9,8 @@ Refer to pytest.ini for configuration https://pytest-asyncio.readthedocs.io/en/latest/reference/markers/index.html + TODO: check if setup and teardown can be turned into async + """ diff --git a/tests/test_card_types.py b/tests/test_card_types.py index 1e459c3e..18bdb122 100644 --- a/tests/test_card_types.py +++ b/tests/test_card_types.py @@ -3,11 +3,11 @@ """ -def test_get_card_types(): +async def test_get_card_types(): from gallagher.cc.cardholders.card_type import CardType from gallagher.dto.card_type import CardTypeResponse - response = CardType.list() + response = await CardType.list() assert type(response) is CardTypeResponse assert type(response.results) is list assert len(response.results) > 0 diff --git a/tests/test_cardholder.py b/tests/test_cardholder.py index 29f112d9..61e6d1d1 100644 --- a/tests/test_cardholder.py +++ b/tests/test_cardholder.py @@ -3,18 +3,18 @@ """ -def test_cardholder_list(): +async def test_cardholder_list(): from gallagher.cc.cardholders.cardholders import Cardholder from gallagher.dto.cardholder import CardholderSummaryResponse - response = Cardholder.list() + response = await Cardholder.list() assert type(response) is CardholderSummaryResponse assert type(response.results) is list assert len(response.results) > 0 -def test_cardholder_detail(): +async def test_cardholder_detail(): from gallagher.cc.cardholders.cardholders import Cardholder from gallagher.dto.cardholder import ( @@ -22,7 +22,7 @@ def test_cardholder_detail(): CardholderDetail, ) - response = Cardholder.list() + response = await Cardholder.list() assert type(response) is CardholderSummaryResponse for cardholder_summary in response.results: diff --git a/tests/test_day_category.py b/tests/test_day_category.py index b36947fc..c0f784a2 100644 --- a/tests/test_day_category.py +++ b/tests/test_day_category.py @@ -3,12 +3,12 @@ """ -def test_day_category(): +async def test_day_category(): from gallagher.cc.alarms.day_category import DayCategory from gallagher.dto.day_category import DayCategoryResponse - response = DayCategory.list() + response = await DayCategory.list() assert type(response) is DayCategoryResponse assert type(response.results) is list assert len(response.results) > 0 diff --git a/tests/test_discover.py b/tests/test_discover.py index c33fbe91..f9caa99d 100644 --- a/tests/test_discover.py +++ b/tests/test_discover.py @@ -3,7 +3,7 @@ """ -def test_discover(): +async def test_discover(): """ """ diff --git a/tests/test_divisions.py b/tests/test_divisions.py index f2d38100..3d1af3d4 100644 --- a/tests/test_divisions.py +++ b/tests/test_divisions.py @@ -1,26 +1,26 @@ -def test_division_list(): +async def test_division_list(): from gallagher.cc.alarms.divisions import Division from gallagher.dto.division import DivisionDetailResponse - response = Division.list() + response = await Division.list() assert type(response) is DivisionDetailResponse assert type(response.results) is list assert len(response.results) > 0 -def test_division_detail(): +async def test_division_detail(): from gallagher.cc.alarms.divisions import Division from gallagher.dto.division import ( DivisionDetailResponse, DivisionDetail, ) - response = Division.list() + response = await Division.list() assert type(response) is DivisionDetailResponse assert type(response.results) is list for division_summary in response.results: # Get the detail of the division - division_detail_response = Division.retrieve(division_summary.id) + division_detail_response = await Division.retrieve(division_summary.id) assert type(division_detail_response) is DivisionDetail assert division_detail_response.id == division_summary.id diff --git a/tests/test_events.py b/tests/test_events.py index 7fdea099..97b5e974 100644 --- a/tests/test_events.py +++ b/tests/test_events.py @@ -1,10 +1,10 @@ -def test_event_types(): +async def test_event_types(): from gallagher.cc.alarms.events import EventType from gallagher.dto.event import ( EventTypeResponse, ) - response = EventType.list() + response = await EventType.list() assert type(response) is EventTypeResponse diff --git a/tests/test_items.py b/tests/test_items.py index 2e83b20f..49a9f93a 100644 --- a/tests/test_items.py +++ b/tests/test_items.py @@ -4,7 +4,7 @@ """ -def test_items_types_list(): +async def test_items_types_list(): """ Get a list of item types and iterates through it these are a summary response @@ -12,13 +12,13 @@ def test_items_types_list(): from gallagher.cc.alarms.items import ItemsTypes from gallagher.dto.items import ItemTypesResponse - response = ItemsTypes.list() + response = await ItemsTypes.list() assert type(response) is ItemTypesResponse assert type(response.item_types) is list assert len(response.item_types) > 0 -def test_items_list(): +async def test_items_list(): """ Get a list of items and this should feed into fetching each one of these on it's own. @@ -26,13 +26,13 @@ def test_items_list(): from gallagher.cc.alarms.items import Item from gallagher.dto.items import ItemsSummaryResponse - response = Item.list() + response = await Item.list() assert type(response) is ItemsSummaryResponse assert type(response.results) is list assert len(response.results) > 0 -def test_item_detail(): +async def test_item_detail(): """ Get each item in the list and make sure it's a valid item """ @@ -42,11 +42,11 @@ def test_item_detail(): ItemDetail ) - response: ItemsSummaryResponse = Item.list() + response: ItemsSummaryResponse = await Item.list() assert type(response) is ItemsSummaryResponse for item_summary in response.results: # Get the detail of the item - item_detail_response = Item.retrieve(item_summary.id) + item_detail_response = await Item.retrieve(item_summary.id) assert type(item_detail_response) is ItemDetail assert (item_detail_response.id == item_summary.id) diff --git a/tests/test_schedule.py b/tests/test_schedule.py index 7549a546..94f3fb64 100644 --- a/tests/test_schedule.py +++ b/tests/test_schedule.py @@ -4,12 +4,12 @@ """ -def test_schedules_list(): +async def test_schedules_list(): from gallagher.cc.alarms.schedule import Schedule from gallagher.dto.schedule import ScheduleSummaryResponse - response = Schedule.list() + response = await Schedule.list() assert type(response) is ScheduleSummaryResponse assert type(response.results) is list assert len(response.results) > 0 diff --git a/tests/test_version.py b/tests/test_version.py index d1adffdc..0944a78f 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -6,5 +6,5 @@ from gallagher import __version__ -def test_version(): +async def test_version(): assert __version__ == '0.1.0-alpha.1'