From 97a1dbd8c52ca72b1a08e686d1255dd7b3f26797 Mon Sep 17 00:00:00 2001 From: llbbl Date: Mon, 30 Jun 2025 23:03:17 -0500 Subject: [PATCH] feat: Add Python testing infrastructure with Poetry and pytest - Set up Poetry as package manager with pyproject.toml configuration - Add pytest, pytest-cov, and pytest-mock as dev dependencies - Configure pytest with coverage reporting and custom markers - Create test directory structure with unit/integration subdirs - Add comprehensive conftest.py with Kodi-specific fixtures - Update .gitignore with testing and Poetry entries - Add validation tests to verify infrastructure setup - Configure test commands accessible via `poetry run test[s]` --- .gitignore | 42 +++++ poetry.lock | 282 ++++++++++++++++++++++++++++++ pyproject.toml | 85 +++++++++ tests/__init__.py | 0 tests/conftest.py | 319 ++++++++++++++++++++++++++++++++++ tests/integration/__init__.py | 0 tests/test_infrastructure.py | 129 ++++++++++++++ tests/unit/__init__.py | 0 8 files changed, 857 insertions(+) create mode 100644 poetry.lock create mode 100644 pyproject.toml create mode 100644 tests/__init__.py create mode 100644 tests/conftest.py create mode 100644 tests/integration/__init__.py create mode 100644 tests/test_infrastructure.py create mode 100644 tests/unit/__init__.py diff --git a/.gitignore b/.gitignore index 1b8b403..eff56c2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,45 @@ /env/ *.pyc *.pyo + +# Testing +.pytest_cache/ +.coverage +htmlcov/ +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.coverage.* + +# Claude +.claude/* + +# Virtual environments +venv/ +.venv/ +ENV/ +.env/ +env.bak/ +venv.bak/ + +# Build artifacts +build/ +dist/ +*.egg-info/ +*.egg +__pycache__/ + +# IDE files +.vscode/ +*.swp +*.swo +*~ +.project +.pydevproject + +# OS files +.DS_Store +Thumbs.db +.Spotlight-V100 +.Trashes diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..aae71f4 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,282 @@ +# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["dev"] +markers = "sys_platform == \"win32\"" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "coverage" +version = "7.6.1" +description = "Code coverage measurement for Python" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "coverage-7.6.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b06079abebbc0e89e6163b8e8f0e16270124c154dc6e4a47b413dd538859af16"}, + {file = "coverage-7.6.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:cf4b19715bccd7ee27b6b120e7e9dd56037b9c0681dcc1adc9ba9db3d417fa36"}, + {file = "coverage-7.6.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e61c0abb4c85b095a784ef23fdd4aede7a2628478e7baba7c5e3deba61070a02"}, + {file = "coverage-7.6.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fd21f6ae3f08b41004dfb433fa895d858f3f5979e7762d052b12aef444e29afc"}, + {file = "coverage-7.6.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f59d57baca39b32db42b83b2a7ba6f47ad9c394ec2076b084c3f029b7afca23"}, + {file = "coverage-7.6.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a1ac0ae2b8bd743b88ed0502544847c3053d7171a3cff9228af618a068ed9c34"}, + {file = "coverage-7.6.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e6a08c0be454c3b3beb105c0596ebdc2371fab6bb90c0c0297f4e58fd7e1012c"}, + {file = "coverage-7.6.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:f5796e664fe802da4f57a168c85359a8fbf3eab5e55cd4e4569fbacecc903959"}, + {file = "coverage-7.6.1-cp310-cp310-win32.whl", hash = "sha256:7bb65125fcbef8d989fa1dd0e8a060999497629ca5b0efbca209588a73356232"}, + {file = "coverage-7.6.1-cp310-cp310-win_amd64.whl", hash = "sha256:3115a95daa9bdba70aea750db7b96b37259a81a709223c8448fa97727d546fe0"}, + {file = "coverage-7.6.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7dea0889685db8550f839fa202744652e87c60015029ce3f60e006f8c4462c93"}, + {file = "coverage-7.6.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ed37bd3c3b063412f7620464a9ac1314d33100329f39799255fb8d3027da50d3"}, + {file = "coverage-7.6.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d85f5e9a5f8b73e2350097c3756ef7e785f55bd71205defa0bfdaf96c31616ff"}, + {file = "coverage-7.6.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9bc572be474cafb617672c43fe989d6e48d3c83af02ce8de73fff1c6bb3c198d"}, + {file = "coverage-7.6.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0c0420b573964c760df9e9e86d1a9a622d0d27f417e1a949a8a66dd7bcee7bc6"}, + {file = "coverage-7.6.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1f4aa8219db826ce6be7099d559f8ec311549bfc4046f7f9fe9b5cea5c581c56"}, + {file = "coverage-7.6.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:fc5a77d0c516700ebad189b587de289a20a78324bc54baee03dd486f0855d234"}, + {file = "coverage-7.6.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b48f312cca9621272ae49008c7f613337c53fadca647d6384cc129d2996d1133"}, + {file = "coverage-7.6.1-cp311-cp311-win32.whl", hash = "sha256:1125ca0e5fd475cbbba3bb67ae20bd2c23a98fac4e32412883f9bcbaa81c314c"}, + {file = "coverage-7.6.1-cp311-cp311-win_amd64.whl", hash = "sha256:8ae539519c4c040c5ffd0632784e21b2f03fc1340752af711f33e5be83a9d6c6"}, + {file = "coverage-7.6.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:95cae0efeb032af8458fc27d191f85d1717b1d4e49f7cb226cf526ff28179778"}, + {file = "coverage-7.6.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5621a9175cf9d0b0c84c2ef2b12e9f5f5071357c4d2ea6ca1cf01814f45d2391"}, + {file = "coverage-7.6.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:260933720fdcd75340e7dbe9060655aff3af1f0c5d20f46b57f262ab6c86a5e8"}, + {file = "coverage-7.6.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:07e2ca0ad381b91350c0ed49d52699b625aab2b44b65e1b4e02fa9df0e92ad2d"}, + {file = "coverage-7.6.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c44fee9975f04b33331cb8eb272827111efc8930cfd582e0320613263ca849ca"}, + {file = "coverage-7.6.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:877abb17e6339d96bf08e7a622d05095e72b71f8afd8a9fefc82cf30ed944163"}, + {file = "coverage-7.6.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:3e0cadcf6733c09154b461f1ca72d5416635e5e4ec4e536192180d34ec160f8a"}, + {file = "coverage-7.6.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c3c02d12f837d9683e5ab2f3d9844dc57655b92c74e286c262e0fc54213c216d"}, + {file = "coverage-7.6.1-cp312-cp312-win32.whl", hash = "sha256:e05882b70b87a18d937ca6768ff33cc3f72847cbc4de4491c8e73880766718e5"}, + {file = "coverage-7.6.1-cp312-cp312-win_amd64.whl", hash = "sha256:b5d7b556859dd85f3a541db6a4e0167b86e7273e1cdc973e5b175166bb634fdb"}, + {file = "coverage-7.6.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a4acd025ecc06185ba2b801f2de85546e0b8ac787cf9d3b06e7e2a69f925b106"}, + {file = "coverage-7.6.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a6d3adcf24b624a7b778533480e32434a39ad8fa30c315208f6d3e5542aeb6e9"}, + {file = "coverage-7.6.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d0c212c49b6c10e6951362f7c6df3329f04c2b1c28499563d4035d964ab8e08c"}, + {file = "coverage-7.6.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6e81d7a3e58882450ec4186ca59a3f20a5d4440f25b1cff6f0902ad890e6748a"}, + {file = "coverage-7.6.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:78b260de9790fd81e69401c2dc8b17da47c8038176a79092a89cb2b7d945d060"}, + {file = "coverage-7.6.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a78d169acd38300060b28d600344a803628c3fd585c912cacc9ea8790fe96862"}, + {file = "coverage-7.6.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:2c09f4ce52cb99dd7505cd0fc8e0e37c77b87f46bc9c1eb03fe3bc9991085388"}, + {file = "coverage-7.6.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6878ef48d4227aace338d88c48738a4258213cd7b74fd9a3d4d7582bb1d8a155"}, + {file = "coverage-7.6.1-cp313-cp313-win32.whl", hash = "sha256:44df346d5215a8c0e360307d46ffaabe0f5d3502c8a1cefd700b34baf31d411a"}, + {file = "coverage-7.6.1-cp313-cp313-win_amd64.whl", hash = "sha256:8284cf8c0dd272a247bc154eb6c95548722dce90d098c17a883ed36e67cdb129"}, + {file = "coverage-7.6.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:d3296782ca4eab572a1a4eca686d8bfb00226300dcefdf43faa25b5242ab8a3e"}, + {file = "coverage-7.6.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:502753043567491d3ff6d08629270127e0c31d4184c4c8d98f92c26f65019962"}, + {file = "coverage-7.6.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6a89ecca80709d4076b95f89f308544ec8f7b4727e8a547913a35f16717856cb"}, + {file = "coverage-7.6.1-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a318d68e92e80af8b00fa99609796fdbcdfef3629c77c6283566c6f02c6d6704"}, + {file = "coverage-7.6.1-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:13b0a73a0896988f053e4fbb7de6d93388e6dd292b0d87ee51d106f2c11b465b"}, + {file = "coverage-7.6.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:4421712dbfc5562150f7554f13dde997a2e932a6b5f352edcce948a815efee6f"}, + {file = "coverage-7.6.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:166811d20dfea725e2e4baa71fffd6c968a958577848d2131f39b60043400223"}, + {file = "coverage-7.6.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:225667980479a17db1048cb2bf8bfb39b8e5be8f164b8f6628b64f78a72cf9d3"}, + {file = "coverage-7.6.1-cp313-cp313t-win32.whl", hash = "sha256:170d444ab405852903b7d04ea9ae9b98f98ab6d7e63e1115e82620807519797f"}, + {file = "coverage-7.6.1-cp313-cp313t-win_amd64.whl", hash = "sha256:b9f222de8cded79c49bf184bdbc06630d4c58eec9459b939b4a690c82ed05657"}, + {file = "coverage-7.6.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6db04803b6c7291985a761004e9060b2bca08da6d04f26a7f2294b8623a0c1a0"}, + {file = "coverage-7.6.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:f1adfc8ac319e1a348af294106bc6a8458a0f1633cc62a1446aebc30c5fa186a"}, + {file = "coverage-7.6.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a95324a9de9650a729239daea117df21f4b9868ce32e63f8b650ebe6cef5595b"}, + {file = "coverage-7.6.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b43c03669dc4618ec25270b06ecd3ee4fa94c7f9b3c14bae6571ca00ef98b0d3"}, + {file = "coverage-7.6.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8929543a7192c13d177b770008bc4e8119f2e1f881d563fc6b6305d2d0ebe9de"}, + {file = "coverage-7.6.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:a09ece4a69cf399510c8ab25e0950d9cf2b42f7b3cb0374f95d2e2ff594478a6"}, + {file = "coverage-7.6.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:9054a0754de38d9dbd01a46621636689124d666bad1936d76c0341f7d71bf569"}, + {file = "coverage-7.6.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:0dbde0f4aa9a16fa4d754356a8f2e36296ff4d83994b2c9d8398aa32f222f989"}, + {file = "coverage-7.6.1-cp38-cp38-win32.whl", hash = "sha256:da511e6ad4f7323ee5702e6633085fb76c2f893aaf8ce4c51a0ba4fc07580ea7"}, + {file = "coverage-7.6.1-cp38-cp38-win_amd64.whl", hash = "sha256:3f1156e3e8f2872197af3840d8ad307a9dd18e615dc64d9ee41696f287c57ad8"}, + {file = "coverage-7.6.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:abd5fd0db5f4dc9289408aaf34908072f805ff7792632250dcb36dc591d24255"}, + {file = "coverage-7.6.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:547f45fa1a93154bd82050a7f3cddbc1a7a4dd2a9bf5cb7d06f4ae29fe94eaf8"}, + {file = "coverage-7.6.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:645786266c8f18a931b65bfcefdbf6952dd0dea98feee39bd188607a9d307ed2"}, + {file = "coverage-7.6.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9e0b2df163b8ed01d515807af24f63de04bebcecbd6c3bfeff88385789fdf75a"}, + {file = "coverage-7.6.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:609b06f178fe8e9f89ef676532760ec0b4deea15e9969bf754b37f7c40326dbc"}, + {file = "coverage-7.6.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:702855feff378050ae4f741045e19a32d57d19f3e0676d589df0575008ea5004"}, + {file = "coverage-7.6.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:2bdb062ea438f22d99cba0d7829c2ef0af1d768d1e4a4f528087224c90b132cb"}, + {file = "coverage-7.6.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:9c56863d44bd1c4fe2abb8a4d6f5371d197f1ac0ebdee542f07f35895fc07f36"}, + {file = "coverage-7.6.1-cp39-cp39-win32.whl", hash = "sha256:6e2cd258d7d927d09493c8df1ce9174ad01b381d4729a9d8d4e38670ca24774c"}, + {file = "coverage-7.6.1-cp39-cp39-win_amd64.whl", hash = "sha256:06a737c882bd26d0d6ee7269b20b12f14a8704807a01056c80bb881a4b2ce6ca"}, + {file = "coverage-7.6.1-pp38.pp39.pp310-none-any.whl", hash = "sha256:e9a6e0eb86070e8ccaedfbd9d38fec54864f3125ab95419970575b42af7541df"}, + {file = "coverage-7.6.1.tar.gz", hash = "sha256:953510dfb7b12ab69d20135a0662397f077c59b1e6379a768e97c59d852ee51d"}, +] + +[package.dependencies] +tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""} + +[package.extras] +toml = ["tomli ; python_full_version <= \"3.11.0a6\""] + +[[package]] +name = "exceptiongroup" +version = "1.3.0" +description = "Backport of PEP 654 (exception groups)" +optional = false +python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version < \"3.11\"" +files = [ + {file = "exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10"}, + {file = "exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.13\""} + +[package.extras] +test = ["pytest (>=6)"] + +[[package]] +name = "iniconfig" +version = "2.1.0" +description = "brain-dead simple config-ini parsing" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760"}, + {file = "iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7"}, +] + +[[package]] +name = "packaging" +version = "25.0" +description = "Core utilities for Python packages" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"}, + {file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"}, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +description = "plugin and hook calling mechanisms for python" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, + {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + +[[package]] +name = "pytest" +version = "8.3.5" +description = "pytest: simple powerful testing with Python" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "pytest-8.3.5-py3-none-any.whl", hash = "sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820"}, + {file = "pytest-8.3.5.tar.gz", hash = "sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=1.5,<2" +tomli = {version = ">=1", markers = "python_version < \"3.11\""} + +[package.extras] +dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] + +[[package]] +name = "pytest-cov" +version = "5.0.0" +description = "Pytest plugin for measuring coverage." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "pytest-cov-5.0.0.tar.gz", hash = "sha256:5837b58e9f6ebd335b0f8060eecce69b662415b16dc503883a02f45dfeb14857"}, + {file = "pytest_cov-5.0.0-py3-none-any.whl", hash = "sha256:4f0764a1219df53214206bf1feea4633c3b558a2925c8b59f144f682861ce652"}, +] + +[package.dependencies] +coverage = {version = ">=5.2.1", extras = ["toml"]} +pytest = ">=4.6" + +[package.extras] +testing = ["fields", "hunter", "process-tests", "pytest-xdist", "virtualenv"] + +[[package]] +name = "pytest-mock" +version = "3.14.1" +description = "Thin-wrapper around the mock package for easier use with pytest" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "pytest_mock-3.14.1-py3-none-any.whl", hash = "sha256:178aefcd11307d874b4cd3100344e7e2d888d9791a6a1d9bfe90fbc1b74fd1d0"}, + {file = "pytest_mock-3.14.1.tar.gz", hash = "sha256:159e9edac4c451ce77a5cdb9fc5d1100708d2dd4ba3c3df572f14097351af80e"}, +] + +[package.dependencies] +pytest = ">=6.2.5" + +[package.extras] +dev = ["pre-commit", "pytest-asyncio", "tox"] + +[[package]] +name = "tomli" +version = "2.2.1" +description = "A lil' TOML parser" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +markers = "python_full_version <= \"3.11.0a6\"" +files = [ + {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, + {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8"}, + {file = "tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff"}, + {file = "tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b"}, + {file = "tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea"}, + {file = "tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e"}, + {file = "tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98"}, + {file = "tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4"}, + {file = "tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7"}, + {file = "tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744"}, + {file = "tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec"}, + {file = "tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69"}, + {file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"}, + {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, +] + +[[package]] +name = "typing-extensions" +version = "4.13.2" +description = "Backported and Experimental Type Hints for Python 3.8+" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +markers = "python_version < \"3.11\"" +files = [ + {file = "typing_extensions-4.13.2-py3-none-any.whl", hash = "sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c"}, + {file = "typing_extensions-4.13.2.tar.gz", hash = "sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef"}, +] + +[metadata] +lock-version = "2.1" +python-versions = "^3.8" +content-hash = "96176c9214534068f3ea7c00be51c23e9d99a8b4862eed2791d0a0cb449ad1e0" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..7c2ed84 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,85 @@ +[tool.poetry] +name = "plugin-googledrive" +version = "1.5.0" +description = "Google Drive plugin for Kodi" +authors = ["Carlos Guzman (cguZZman)"] +license = "GPL-3.0-or-later" +readme = "README.md" +repository = "https://github.com/cguZZman/plugin.googledrive" +packages = [{include = "resources"}] + +[tool.poetry.dependencies] +python = "^3.8" + +[tool.poetry.group.dev.dependencies] +pytest = "^8.0.0" +pytest-cov = "^5.0.0" +pytest-mock = "^3.14.0" + +[tool.poetry.scripts] +test = "pytest:main" +tests = "pytest:main" + +[tool.pytest.ini_options] +minversion = "8.0" +testpaths = ["tests"] +python_files = ["test_*.py", "*_test.py"] +python_classes = ["Test*"] +python_functions = ["test_*"] +addopts = [ + "-ra", + "--strict-markers", + "--cov=resources", + "--cov-report=term-missing", + "--cov-report=html", + "--cov-report=xml", + "--cov-fail-under=0", + "-v" +] +markers = [ + "unit: Mark test as a unit test", + "integration: Mark test as an integration test", + "slow: Mark test as slow running" +] +filterwarnings = [ + "error", + "ignore::UserWarning", + "ignore::DeprecationWarning" +] + +[tool.coverage.run] +source = ["resources"] +omit = [ + "*/tests/*", + "*/__pycache__/*", + "*/venv/*", + "*/.venv/*", + "*/env/*", + "*/.env/*" +] + +[tool.coverage.report] +exclude_lines = [ + "pragma: no cover", + "def __repr__", + "def __str__", + "raise AssertionError", + "raise NotImplementedError", + "if __name__ == .__main__.:", + "if TYPE_CHECKING:", + "class .*\\bProtocol\\):", + "@(abc\\.)?abstractmethod" +] +precision = 2 +show_missing = true +skip_covered = false + +[tool.coverage.html] +directory = "htmlcov" + +[tool.coverage.xml] +output = "coverage.xml" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..622f007 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,319 @@ +""" +Shared pytest fixtures and configuration for the Google Drive Kodi plugin tests. +""" +import os +import sys +import tempfile +import shutil +from pathlib import Path +from unittest.mock import Mock, MagicMock +import pytest + +# Add the resources directory to the Python path for imports +sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), 'resources')) + + +@pytest.fixture +def temp_dir(): + """ + Create a temporary directory that is automatically cleaned up after the test. + + Returns: + Path: Path object pointing to the temporary directory + """ + temp_path = tempfile.mkdtemp() + yield Path(temp_path) + shutil.rmtree(temp_path) + + +@pytest.fixture +def mock_addon(): + """ + Create a mock Kodi addon object with common properties and methods. + + Returns: + Mock: Mock addon object + """ + addon = Mock() + addon.getAddonInfo = Mock(side_effect=lambda x: { + 'id': 'plugin.googledrive', + 'name': 'Google Drive', + 'version': '1.5.0', + 'path': '/path/to/addon', + 'profile': '/path/to/addon/profile' + }.get(x, '')) + + addon.getSetting = Mock(return_value='') + addon.setSetting = Mock() + addon.getLocalizedString = Mock(side_effect=lambda x: f'String {x}') + + return addon + + +@pytest.fixture +def mock_xbmc(): + """ + Create a mock xbmc module with common functions. + + Returns: + Mock: Mock xbmc module + """ + xbmc = Mock() + xbmc.log = Mock() + xbmc.LOGDEBUG = 0 + xbmc.LOGINFO = 1 + xbmc.LOGWARNING = 2 + xbmc.LOGERROR = 3 + xbmc.LOGFATAL = 4 + xbmc.translatePath = Mock(side_effect=lambda x: x) + + return xbmc + + +@pytest.fixture +def mock_xbmcgui(): + """ + Create a mock xbmcgui module with common UI elements. + + Returns: + Mock: Mock xbmcgui module + """ + xbmcgui = Mock() + + # Mock Dialog class + dialog = Mock() + dialog.ok = Mock(return_value=True) + dialog.yesno = Mock(return_value=True) + dialog.notification = Mock() + dialog.input = Mock(return_value='test_input') + dialog.select = Mock(return_value=0) + dialog.multiselect = Mock(return_value=[0]) + dialog.browse = Mock(return_value='/test/path') + dialog.browseSingle = Mock(return_value='/test/path') + dialog.browseMutiple = Mock(return_value=['/test/path']) + dialog.numeric = Mock(return_value='123') + + xbmcgui.Dialog = Mock(return_value=dialog) + + # Mock ListItem class + list_item = Mock() + list_item.setLabel = Mock() + list_item.setLabel2 = Mock() + list_item.setArt = Mock() + list_item.setInfo = Mock() + list_item.setProperty = Mock() + list_item.addContextMenuItems = Mock() + list_item.setPath = Mock() + + xbmcgui.ListItem = Mock(return_value=list_item) + + # Mock WindowXML and WindowXMLDialog + xbmcgui.WindowXML = Mock + xbmcgui.WindowXMLDialog = Mock + + return xbmcgui + + +@pytest.fixture +def mock_xbmcplugin(): + """ + Create a mock xbmcplugin module with common plugin functions. + + Returns: + Mock: Mock xbmcplugin module + """ + xbmcplugin = Mock() + xbmcplugin.addDirectoryItem = Mock(return_value=True) + xbmcplugin.addDirectoryItems = Mock(return_value=True) + xbmcplugin.endOfDirectory = Mock() + xbmcplugin.setResolvedUrl = Mock() + xbmcplugin.setContent = Mock() + xbmcplugin.setSetting = Mock() + xbmcplugin.setPluginCategory = Mock() + xbmcplugin.setPluginFanart = Mock() + xbmcplugin.addSortMethod = Mock() + + # Sort methods + xbmcplugin.SORT_METHOD_NONE = 0 + xbmcplugin.SORT_METHOD_LABEL = 1 + xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE = 2 + xbmcplugin.SORT_METHOD_DATE = 3 + xbmcplugin.SORT_METHOD_SIZE = 4 + xbmcplugin.SORT_METHOD_FILE = 5 + xbmcplugin.SORT_METHOD_DRIVE_TYPE = 6 + xbmcplugin.SORT_METHOD_TRACKNUM = 7 + xbmcplugin.SORT_METHOD_DURATION = 8 + xbmcplugin.SORT_METHOD_TITLE = 9 + xbmcplugin.SORT_METHOD_TITLE_IGNORE_THE = 10 + + return xbmcplugin + + +@pytest.fixture +def mock_kodi_modules(mock_xbmc, mock_xbmcgui, mock_xbmcplugin, mock_addon): + """ + Mock all common Kodi modules and make them available in sys.modules. + + This fixture combines all Kodi-related mocks and injects them into sys.modules + so that imports will work correctly in the tested code. + """ + modules = { + 'xbmc': mock_xbmc, + 'xbmcgui': mock_xbmcgui, + 'xbmcplugin': mock_xbmcplugin, + 'xbmcaddon': Mock(Addon=Mock(return_value=mock_addon)) + } + + # Store original modules + original_modules = {} + for module_name in modules: + if module_name in sys.modules: + original_modules[module_name] = sys.modules[module_name] + + # Replace with mocks + sys.modules.update(modules) + + yield modules + + # Restore original modules + for module_name in modules: + if module_name in original_modules: + sys.modules[module_name] = original_modules[module_name] + else: + del sys.modules[module_name] + + +@pytest.fixture +def sample_drive_item(): + """ + Create a sample Google Drive item for testing. + + Returns: + dict: Sample drive item data + """ + return { + 'id': 'test_file_id_123', + 'name': 'test_file.mp4', + 'mimeType': 'video/mp4', + 'size': '1234567890', + 'createdTime': '2023-01-01T00:00:00.000Z', + 'modifiedTime': '2023-06-01T00:00:00.000Z', + 'parents': ['parent_folder_id'], + 'webViewLink': 'https://drive.google.com/file/d/test_file_id_123/view', + 'webContentLink': 'https://drive.google.com/uc?id=test_file_id_123&export=download', + 'thumbnailLink': 'https://drive.google.com/thumbnail?id=test_file_id_123', + 'capabilities': { + 'canDownload': True, + 'canEdit': False, + 'canShare': True + } + } + + +@pytest.fixture +def sample_folder_item(): + """ + Create a sample Google Drive folder for testing. + + Returns: + dict: Sample folder item data + """ + return { + 'id': 'test_folder_id_456', + 'name': 'Test Folder', + 'mimeType': 'application/vnd.google-apps.folder', + 'createdTime': '2023-01-01T00:00:00.000Z', + 'modifiedTime': '2023-06-01T00:00:00.000Z', + 'parents': ['root'], + 'webViewLink': 'https://drive.google.com/drive/folders/test_folder_id_456', + 'capabilities': { + 'canAddChildren': True, + 'canDelete': True, + 'canDownload': False, + 'canListChildren': True + } + } + + +@pytest.fixture +def mock_settings(): + """ + Create a mock settings dictionary with common plugin settings. + + Returns: + dict: Mock settings dictionary + """ + return { + 'client_id': 'test_client_id', + 'client_secret': 'test_client_secret', + 'auth_server': 'https://auth.test.com', + 'cache_size': '100', + 'cache_ttl': '3600', + 'items_per_page': '50', + 'video_quality': 'original', + 'audio_quality': 'original', + 'photo_quality': 'original', + 'subtitle_lang': 'en', + 'download_path': '/tmp/downloads', + 'export_to_library': 'false', + 'library_path': '/tmp/library' + } + + +@pytest.fixture +def mock_http_response(): + """ + Create a mock HTTP response for testing API calls. + + Returns: + Mock: Mock response object + """ + response = Mock() + response.status_code = 200 + response.headers = {'content-type': 'application/json'} + response.json = Mock(return_value={ + 'kind': 'drive#fileList', + 'files': [], + 'nextPageToken': None + }) + response.text = '{"kind": "drive#fileList", "files": [], "nextPageToken": null}' + response.content = b'{"kind": "drive#fileList", "files": [], "nextPageToken": null}' + response.raise_for_status = Mock() + + return response + + +@pytest.fixture(autouse=True) +def reset_modules(): + """ + Automatically reset certain modules between tests to ensure clean state. + """ + # List of modules that should be removed from sys.modules between tests + modules_to_reset = [ + 'addon', + 'provider', + 'provider.googledrive' + ] + + yield + + # Remove specified modules from sys.modules + for module in modules_to_reset: + if module in sys.modules: + del sys.modules[module] + + +@pytest.fixture +def capture_logs(): + """ + Capture xbmc.log calls for assertion in tests. + + Returns: + list: List of tuples (log_level, message) for each log call + """ + logs = [] + + def log_capture(msg, level=0): + logs.append((level, str(msg))) + + return logs, log_capture \ No newline at end of file diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_infrastructure.py b/tests/test_infrastructure.py new file mode 100644 index 0000000..5b947e0 --- /dev/null +++ b/tests/test_infrastructure.py @@ -0,0 +1,129 @@ +""" +Validation tests to verify the testing infrastructure is properly set up. +""" +import pytest +import sys +import os +from pathlib import Path + + +class TestInfrastructure: + """Test class to validate the testing infrastructure setup.""" + + def test_pytest_is_available(self): + """Verify that pytest is installed and importable.""" + import pytest + assert pytest.__version__ + + def test_pytest_cov_is_available(self): + """Verify that pytest-cov is installed and importable.""" + import pytest_cov + assert pytest_cov + + def test_pytest_mock_is_available(self): + """Verify that pytest-mock is installed and importable.""" + import pytest_mock + assert pytest_mock + + def test_project_structure_exists(self): + """Verify that the expected project structure exists.""" + project_root = Path(__file__).parent.parent + + # Check main directories + assert project_root.exists() + assert (project_root / 'resources').exists() + assert (project_root / 'resources' / 'lib').exists() + assert (project_root / 'resources' / 'lib' / 'provider').exists() + + # Check test directories + assert (project_root / 'tests').exists() + assert (project_root / 'tests' / 'unit').exists() + assert (project_root / 'tests' / 'integration').exists() + + # Check configuration files + assert (project_root / 'pyproject.toml').exists() + assert (project_root / '.gitignore').exists() + + def test_conftest_fixtures_are_available(self, temp_dir, mock_addon, mock_xbmc): + """Verify that conftest fixtures are properly loaded.""" + # Test temp_dir fixture + assert temp_dir.exists() + assert temp_dir.is_dir() + + # Test mock_addon fixture + assert mock_addon.getAddonInfo('id') == 'plugin.googledrive' + assert mock_addon.getAddonInfo('name') == 'Google Drive' + + # Test mock_xbmc fixture + assert hasattr(mock_xbmc, 'log') + assert hasattr(mock_xbmc, 'LOGDEBUG') + + def test_resources_in_python_path(self): + """Verify that resources directory is in Python path.""" + resources_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'resources') + assert resources_path in sys.path + + @pytest.mark.unit + def test_unit_marker_works(self): + """Verify that the unit test marker works correctly.""" + assert True + + @pytest.mark.integration + def test_integration_marker_works(self): + """Verify that the integration test marker works correctly.""" + assert True + + @pytest.mark.slow + def test_slow_marker_works(self): + """Verify that the slow test marker works correctly.""" + import time + time.sleep(0.1) # Simulate a slow test + assert True + + def test_mock_kodi_modules(self, mock_kodi_modules): + """Verify that Kodi modules can be mocked properly.""" + # Modules should be in the fixture return + assert 'xbmc' in mock_kodi_modules + assert 'xbmcgui' in mock_kodi_modules + assert 'xbmcplugin' in mock_kodi_modules + assert 'xbmcaddon' in mock_kodi_modules + + # They should also be importable + import xbmc + import xbmcgui + import xbmcplugin + import xbmcaddon + + # Verify basic functionality + assert hasattr(xbmc, 'log') + assert hasattr(xbmcgui, 'Dialog') + assert hasattr(xbmcplugin, 'addDirectoryItem') + assert hasattr(xbmcaddon, 'Addon') + + def test_sample_fixtures(self, sample_drive_item, sample_folder_item): + """Verify that sample data fixtures work correctly.""" + # Test drive item + assert sample_drive_item['id'] == 'test_file_id_123' + assert sample_drive_item['mimeType'] == 'video/mp4' + assert 'capabilities' in sample_drive_item + + # Test folder item + assert sample_folder_item['id'] == 'test_folder_id_456' + assert sample_folder_item['mimeType'] == 'application/vnd.google-apps.folder' + assert sample_folder_item['capabilities']['canListChildren'] is True + + def test_coverage_will_be_generated(self): + """Verify that coverage will be generated for the resources module.""" + # This test just ensures we're set up to measure coverage + from pathlib import Path + resources_path = Path(__file__).parent.parent / 'resources' + assert resources_path.exists() + + # Try to import a module from resources to ensure it can be covered + sys.path.insert(0, str(resources_path.parent)) + try: + from resources import __init__ + assert True # If we get here, import worked + except ImportError: + # This is okay, just means the module structure is different + pass \ No newline at end of file diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py new file mode 100644 index 0000000..e69de29