ara-cli 0.1.9.69__py3-none-any.whl → 0.1.10.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ara-cli might be problematic. Click here for more details.

Files changed (150) hide show
  1. ara_cli/__init__.py +18 -2
  2. ara_cli/__main__.py +248 -62
  3. ara_cli/ara_command_action.py +155 -86
  4. ara_cli/ara_config.py +226 -80
  5. ara_cli/ara_subcommands/__init__.py +0 -0
  6. ara_cli/ara_subcommands/autofix.py +26 -0
  7. ara_cli/ara_subcommands/chat.py +27 -0
  8. ara_cli/ara_subcommands/classifier_directory.py +16 -0
  9. ara_cli/ara_subcommands/common.py +100 -0
  10. ara_cli/ara_subcommands/create.py +75 -0
  11. ara_cli/ara_subcommands/delete.py +22 -0
  12. ara_cli/ara_subcommands/extract.py +22 -0
  13. ara_cli/ara_subcommands/fetch_templates.py +14 -0
  14. ara_cli/ara_subcommands/list.py +65 -0
  15. ara_cli/ara_subcommands/list_tags.py +25 -0
  16. ara_cli/ara_subcommands/load.py +48 -0
  17. ara_cli/ara_subcommands/prompt.py +136 -0
  18. ara_cli/ara_subcommands/read.py +47 -0
  19. ara_cli/ara_subcommands/read_status.py +20 -0
  20. ara_cli/ara_subcommands/read_user.py +20 -0
  21. ara_cli/ara_subcommands/reconnect.py +27 -0
  22. ara_cli/ara_subcommands/rename.py +22 -0
  23. ara_cli/ara_subcommands/scan.py +14 -0
  24. ara_cli/ara_subcommands/set_status.py +22 -0
  25. ara_cli/ara_subcommands/set_user.py +22 -0
  26. ara_cli/ara_subcommands/template.py +16 -0
  27. ara_cli/artefact_autofix.py +649 -68
  28. ara_cli/artefact_creator.py +8 -11
  29. ara_cli/artefact_deleter.py +2 -4
  30. ara_cli/artefact_fuzzy_search.py +22 -10
  31. ara_cli/artefact_link_updater.py +4 -4
  32. ara_cli/artefact_lister.py +29 -55
  33. ara_cli/artefact_models/artefact_data_retrieval.py +23 -0
  34. ara_cli/artefact_models/artefact_load.py +11 -3
  35. ara_cli/artefact_models/artefact_model.py +146 -39
  36. ara_cli/artefact_models/artefact_templates.py +70 -44
  37. ara_cli/artefact_models/businessgoal_artefact_model.py +23 -25
  38. ara_cli/artefact_models/epic_artefact_model.py +34 -26
  39. ara_cli/artefact_models/feature_artefact_model.py +203 -64
  40. ara_cli/artefact_models/keyfeature_artefact_model.py +21 -24
  41. ara_cli/artefact_models/serialize_helper.py +1 -1
  42. ara_cli/artefact_models/task_artefact_model.py +83 -15
  43. ara_cli/artefact_models/userstory_artefact_model.py +37 -27
  44. ara_cli/artefact_models/vision_artefact_model.py +23 -42
  45. ara_cli/artefact_reader.py +92 -91
  46. ara_cli/artefact_renamer.py +8 -4
  47. ara_cli/artefact_scan.py +66 -3
  48. ara_cli/chat.py +622 -162
  49. ara_cli/chat_agent/__init__.py +0 -0
  50. ara_cli/chat_agent/agent_communicator.py +62 -0
  51. ara_cli/chat_agent/agent_process_manager.py +211 -0
  52. ara_cli/chat_agent/agent_status_manager.py +73 -0
  53. ara_cli/chat_agent/agent_workspace_manager.py +76 -0
  54. ara_cli/commands/__init__.py +0 -0
  55. ara_cli/commands/command.py +7 -0
  56. ara_cli/commands/extract_command.py +15 -0
  57. ara_cli/commands/load_command.py +65 -0
  58. ara_cli/commands/load_image_command.py +34 -0
  59. ara_cli/commands/read_command.py +117 -0
  60. ara_cli/completers.py +144 -0
  61. ara_cli/directory_navigator.py +37 -4
  62. ara_cli/error_handler.py +134 -0
  63. ara_cli/file_classifier.py +6 -5
  64. ara_cli/file_lister.py +1 -1
  65. ara_cli/file_loaders/__init__.py +0 -0
  66. ara_cli/file_loaders/binary_file_loader.py +33 -0
  67. ara_cli/file_loaders/document_file_loader.py +34 -0
  68. ara_cli/file_loaders/document_reader.py +245 -0
  69. ara_cli/file_loaders/document_readers.py +233 -0
  70. ara_cli/file_loaders/file_loader.py +50 -0
  71. ara_cli/file_loaders/file_loaders.py +123 -0
  72. ara_cli/file_loaders/image_processor.py +89 -0
  73. ara_cli/file_loaders/markdown_reader.py +75 -0
  74. ara_cli/file_loaders/text_file_loader.py +187 -0
  75. ara_cli/global_file_lister.py +51 -0
  76. ara_cli/list_filter.py +1 -1
  77. ara_cli/output_suppressor.py +1 -1
  78. ara_cli/prompt_extractor.py +215 -88
  79. ara_cli/prompt_handler.py +521 -134
  80. ara_cli/prompt_rag.py +2 -2
  81. ara_cli/tag_extractor.py +83 -38
  82. ara_cli/template_loader.py +245 -0
  83. ara_cli/template_manager.py +18 -13
  84. ara_cli/templates/prompt-modules/commands/empty.commands.md +2 -12
  85. ara_cli/templates/prompt-modules/commands/extract_general.commands.md +12 -0
  86. ara_cli/templates/prompt-modules/commands/extract_markdown.commands.md +11 -0
  87. ara_cli/templates/prompt-modules/commands/extract_python.commands.md +13 -0
  88. ara_cli/templates/prompt-modules/commands/feature_add_or_modifiy_specified_behavior.commands.md +36 -0
  89. ara_cli/templates/prompt-modules/commands/feature_generate_initial_specified_bevahior.commands.md +53 -0
  90. ara_cli/templates/prompt-modules/commands/prompt_template_tech_stack_transformer.commands.md +95 -0
  91. ara_cli/templates/prompt-modules/commands/python_bug_fixing_code.commands.md +34 -0
  92. ara_cli/templates/prompt-modules/commands/python_generate_code.commands.md +27 -0
  93. ara_cli/templates/prompt-modules/commands/python_refactoring_code.commands.md +39 -0
  94. ara_cli/templates/prompt-modules/commands/python_step_definitions_generation_and_fixing.commands.md +40 -0
  95. ara_cli/templates/prompt-modules/commands/python_unittest_generation_and_fixing.commands.md +48 -0
  96. ara_cli/update_config_prompt.py +9 -3
  97. ara_cli/version.py +1 -1
  98. ara_cli-0.1.10.8.dist-info/METADATA +241 -0
  99. ara_cli-0.1.10.8.dist-info/RECORD +193 -0
  100. tests/test_ara_command_action.py +73 -59
  101. tests/test_ara_config.py +341 -36
  102. tests/test_artefact_autofix.py +1060 -0
  103. tests/test_artefact_link_updater.py +3 -3
  104. tests/test_artefact_lister.py +52 -132
  105. tests/test_artefact_renamer.py +2 -2
  106. tests/test_artefact_scan.py +327 -33
  107. tests/test_chat.py +2063 -498
  108. tests/test_file_classifier.py +24 -1
  109. tests/test_file_creator.py +3 -5
  110. tests/test_file_lister.py +1 -1
  111. tests/test_global_file_lister.py +131 -0
  112. tests/test_list_filter.py +2 -2
  113. tests/test_prompt_handler.py +746 -0
  114. tests/test_tag_extractor.py +19 -13
  115. tests/test_template_loader.py +192 -0
  116. tests/test_template_manager.py +5 -4
  117. tests/test_update_config_prompt.py +2 -2
  118. ara_cli/ara_command_parser.py +0 -327
  119. ara_cli/templates/prompt-modules/blueprints/complete_pytest_unittest.blueprint.md +0 -27
  120. ara_cli/templates/prompt-modules/blueprints/task_todo_list_implement_feature_BDD_way.blueprint.md +0 -30
  121. ara_cli/templates/prompt-modules/commands/artefact_classification.commands.md +0 -9
  122. ara_cli/templates/prompt-modules/commands/artefact_extension.commands.md +0 -17
  123. ara_cli/templates/prompt-modules/commands/artefact_formulation.commands.md +0 -14
  124. ara_cli/templates/prompt-modules/commands/behave_step_generation.commands.md +0 -102
  125. ara_cli/templates/prompt-modules/commands/code_generation_complex.commands.md +0 -20
  126. ara_cli/templates/prompt-modules/commands/code_generation_simple.commands.md +0 -13
  127. ara_cli/templates/prompt-modules/commands/error_fixing.commands.md +0 -20
  128. ara_cli/templates/prompt-modules/commands/feature_file_update.commands.md +0 -18
  129. ara_cli/templates/prompt-modules/commands/feature_formulation.commands.md +0 -43
  130. ara_cli/templates/prompt-modules/commands/js_code_generation_simple.commands.md +0 -13
  131. ara_cli/templates/prompt-modules/commands/refactoring.commands.md +0 -15
  132. ara_cli/templates/prompt-modules/commands/refactoring_analysis.commands.md +0 -9
  133. ara_cli/templates/prompt-modules/commands/reverse_engineer_feature_file.commands.md +0 -15
  134. ara_cli/templates/prompt-modules/commands/reverse_engineer_program_flow.commands.md +0 -19
  135. ara_cli/templates/template.businessgoal +0 -10
  136. ara_cli/templates/template.capability +0 -10
  137. ara_cli/templates/template.epic +0 -15
  138. ara_cli/templates/template.example +0 -6
  139. ara_cli/templates/template.feature +0 -26
  140. ara_cli/templates/template.issue +0 -14
  141. ara_cli/templates/template.keyfeature +0 -15
  142. ara_cli/templates/template.task +0 -6
  143. ara_cli/templates/template.userstory +0 -17
  144. ara_cli/templates/template.vision +0 -14
  145. ara_cli-0.1.9.69.dist-info/METADATA +0 -16
  146. ara_cli-0.1.9.69.dist-info/RECORD +0 -158
  147. tests/test_ara_autofix.py +0 -219
  148. {ara_cli-0.1.9.69.dist-info → ara_cli-0.1.10.8.dist-info}/WHEEL +0 -0
  149. {ara_cli-0.1.9.69.dist-info → ara_cli-0.1.10.8.dist-info}/entry_points.txt +0 -0
  150. {ara_cli-0.1.9.69.dist-info → ara_cli-0.1.10.8.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,193 @@
1
+ ara_cli/__init__.py,sha256=w_BYefMe7IdHoAycBTn0VxHr686Ha9oCCVnO5eWjeTU,504
2
+ ara_cli/__main__.py,sha256=S-ZqXq8vZermZ6qCH9sq_T__RXjwDpclysNQk9MfMHY,11435
3
+ ara_cli/ara_command_action.py,sha256=yWtZXxwGp-n5kl-I6bMvwESfyRVGHHBYHVapu-8knl4,24618
4
+ ara_cli/ara_config.py,sha256=vZsY2zYJdlSExRE84L5LqRH3DjveeuMSmG5fC8HDIVc,9794
5
+ ara_cli/artefact_autofix.py,sha256=wLAWKGjhNqXZjsBqy98L3ZpDzg8S5OzFeroJBxGyAAw,26308
6
+ ara_cli/artefact_creator.py,sha256=fRrDaGZvOqJqDb_DLXqMTed2XfIvQMIHjLgOuHOi3Qg,5973
7
+ ara_cli/artefact_deleter.py,sha256=T1vS2s3k_BW86Sd8FExx8nC3BIL05xE9KZLkeZsZrKM,1891
8
+ ara_cli/artefact_fuzzy_search.py,sha256=XMzbMBOJ2YrgFi566jYNB3XeRAmJh7-zqV2QJYbhtlc,3006
9
+ ara_cli/artefact_link_updater.py,sha256=nKdxTpDKqWTOAMD8viKmUaklSFGWzJZ8S8E8xW_ADuM,3775
10
+ ara_cli/artefact_lister.py,sha256=M-ggazAgZ-OLeW9NB48r_sd6zPx0p4hEpeS63qHwI1A,4176
11
+ ara_cli/artefact_reader.py,sha256=-6E1VhIlh2oJE1Rn8ARcHRc_E9N4uk8cEViKMoywm6E,7753
12
+ ara_cli/artefact_renamer.py,sha256=8S4QWD19_FGKsKlWojnu_RUOxx0u9rmLugydM4s4VDc,4219
13
+ ara_cli/artefact_scan.py,sha256=qY2Gp4zVcqMXhtuP7rICW0UBG4pcj3W2ABofnL9SIG8,4806
14
+ ara_cli/chat.py,sha256=_1xjUPuBWFxeXQ-9QDf1pJe5x7Xr9lEaSkeQMrCTpYg,44337
15
+ ara_cli/classifier.py,sha256=zWskj7rBYdqYBGjksBm46iTgVU5IIf2PZsJr4qeiwVU,1878
16
+ ara_cli/codefusionretriever.py,sha256=fCHgXdIBRzkVAnapX-KI2NQ44XbrrF4tEQmn5J6clUI,1980
17
+ ara_cli/codehierachieretriever.py,sha256=Xd3EgEWWhkSf1TmTWtf8X5_YvyE_4B66nRrqarwSiTU,1182
18
+ ara_cli/commandline_completer.py,sha256=b00Dqb5n7SecpxYIDLxAfYhp8X6e3c8a5qYz6ko0i3E,1192
19
+ ara_cli/completers.py,sha256=V4bcmUnuFkdgMpJ3bLAL7cnxinxZb8wwB17WnRHIrHM,5404
20
+ ara_cli/directory_navigator.py,sha256=mr34qhuz8MT2Qj_sTddffCB2nzYpWCg9AWLPdaFjeOM,4518
21
+ ara_cli/error_handler.py,sha256=nNaJSq82f3xiz_QFRKPg5kX_-oI-UoFdRJ2OTj1AR18,4019
22
+ ara_cli/file_classifier.py,sha256=nUcNrhflUydCyCRbXHjEEXYwwwfUm65lYnNEvc86fpM,4026
23
+ ara_cli/file_lister.py,sha256=0C-j8IzajXo5qlvnuy5WFfe43ALwJ-0JFh2K6Xx2ccw,2332
24
+ ara_cli/filename_validator.py,sha256=Aw9PL8d5-Ymhp3EY6lDrUBk3cudaNqo1Uw5RzPpI1jA,118
25
+ ara_cli/global_file_lister.py,sha256=y2UCDoNXODnTAjmlzlV5cf7QxiZ55KEBbbOGQ_JpiHw,2303
26
+ ara_cli/list_filter.py,sha256=qKGwwQsrWe7L5FbdxEbBYD1bbbi8c-RMypjXqXvLbgs,5291
27
+ ara_cli/output_suppressor.py,sha256=nwiHaQLwabOjMoJOeUESBnZszGMxrQZfJ3N2OvahX7Y,389
28
+ ara_cli/prompt_chat.py,sha256=kd_OINDQFit6jN04bb7mzgY259JBbRaTaNp9F-webkc,1346
29
+ ara_cli/prompt_extractor.py,sha256=sMrpxmpPMU76_PBvOU15kuflsG6mgdpSIlGPmnDRpc0,12349
30
+ ara_cli/prompt_handler.py,sha256=3iSdEJe6RL496Gc1KncOREK_Nb9HYr7Ti9KTTwA_sTU,30393
31
+ ara_cli/prompt_rag.py,sha256=ydlhe4CUqz0jdzlY7jBbpKaf_5fjMrAZKnriKea3ZAg,7485
32
+ ara_cli/run_file_lister.py,sha256=XbrrDTJXp1LFGx9Lv91SNsEHZPP-PyEMBF_P4btjbDA,2360
33
+ ara_cli/tag_extractor.py,sha256=vjuPGGlT3mQpez6eY9LLgIBFQqPsTEgfAWODbXlgODc,4057
34
+ ara_cli/template_loader.py,sha256=nYQ4zadcXX6oXSNgFNlXx8u5961BZCj3dw0tSKHdNfE,10756
35
+ ara_cli/template_manager.py,sha256=l2c785YHB7m0e2TjE0CX-nwXrS4v3EiT9qrS5KuatAc,7105
36
+ ara_cli/update_config_prompt.py,sha256=moqj2Kha7S7fEGzTReU0v2y8UjXC8QfnoiieOQr35C4,5157
37
+ ara_cli/version.py,sha256=VrW4sVDpe3z0UrnPRa4kYW5IIh6VoFKe2Q9JTx-prQg,146
38
+ ara_cli/ara_subcommands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
+ ara_cli/ara_subcommands/autofix.py,sha256=h7-6hV97Q6PisUJ_U1Qs4sHYwkHsDpeYH63y_LQsfSc,1095
40
+ ara_cli/ara_subcommands/chat.py,sha256=9zorWKbM0ulu9xFhW2tzV5vl8hCLOCjcp2E9hYgZJ90,1239
41
+ ara_cli/ara_subcommands/classifier_directory.py,sha256=7GH3w4DtvFCM1Sr6Qqk_kjp0EC8jNJDieJJMshYJ_6k,620
42
+ ara_cli/ara_subcommands/common.py,sha256=6bAfPbFHx3CzDSQMm4vL7keFgVnOpqiupgDDWj7QdUQ,2898
43
+ ara_cli/ara_subcommands/create.py,sha256=2tIpzKgzytTIdVV26p6cvrcBo8WLm_3qK7GJyn47Jaw,2527
44
+ ara_cli/ara_subcommands/delete.py,sha256=DxWRQ5Z8h5ZpMhyjLHNuLxONgxIQ97hVkQ8VkX15FDk,827
45
+ ara_cli/ara_subcommands/extract.py,sha256=11atXek579W2RP6PYHlGuyVjWBTuyh1viondCjuce_k,765
46
+ ara_cli/ara_subcommands/fetch_templates.py,sha256=f1bXOTlM67hyf3oGPZEQQjSwUsTte7Cd9-yqq76Ud08,432
47
+ ara_cli/ara_subcommands/list.py,sha256=HtX3kKQ9nrfCcJPxJng0ZnoOqLQ11-aui2zxVei8PlI,3562
48
+ ara_cli/ara_subcommands/list_tags.py,sha256=drEzJgJa4OqqYfIuvT7XkjG4o7VB-ikHE0ArIdljoTI,1113
49
+ ara_cli/ara_subcommands/load.py,sha256=czaflU5Xv-TBlpgalvm6yn5oBBAnNfxSeoIFuLPfi-U,1825
50
+ ara_cli/ara_subcommands/prompt.py,sha256=A8L0lJNBm5zkwJJrzz1kpdycwpm1y8hzd2iVleylpck,4630
51
+ ara_cli/ara_subcommands/read.py,sha256=zTPNMvEPf1WvhtUiauXu5HFiXHRIBJVCkHu44L_scSk,2396
52
+ ara_cli/ara_subcommands/read_status.py,sha256=ZqdxuYXC-idJ2JtMIcZzT4XYI55PnqA6sYv2FcMuchw,695
53
+ ara_cli/ara_subcommands/read_user.py,sha256=NuhaC7dBbi8PUHnGGpqbBVSbQ__nT_L52c7tdKkxjlA,681
54
+ ara_cli/ara_subcommands/reconnect.py,sha256=5Q90rbSnYf7YO6n_9esWsYv7o8GQ-Fnzgy4d8S-X-DQ,1088
55
+ ara_cli/ara_subcommands/rename.py,sha256=IggQdvXjTbZ5CkqzebydVVTcaxO4SDOyORqXDL5jnY8,784
56
+ ara_cli/ara_subcommands/scan.py,sha256=XXwIzq4T9sDMXV0ZcMTSakQ7SyosuCfKjMiiTz7533A,363
57
+ ara_cli/ara_subcommands/set_status.py,sha256=6zzuqLR9k-V63e5UQBpsooftbYHuENEP2s3AdI2jyG0,786
58
+ ara_cli/ara_subcommands/set_user.py,sha256=ADgZIj9xIWK9QKY95lIW_GJGYZysALV--y8j6IuvGxs,755
59
+ ara_cli/ara_subcommands/template.py,sha256=gp_BzrNHcVylU5xav1vmPe3-0vQR7UHm44G7w2i370Q,552
60
+ ara_cli/artefact_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
+ ara_cli/artefact_models/artefact_data_retrieval.py,sha256=CooXOJBYWSyiViN2xkC8baS8OUaslry3YGVVUeDxRAU,527
62
+ ara_cli/artefact_models/artefact_load.py,sha256=IXzWxP-Q_j_oDGMno0m-OuXCQ7Vd5c_NctshGr4ROBw,621
63
+ ara_cli/artefact_models/artefact_mapping.py,sha256=8aD0spBjkJ8toMAmFawc6UTUxB6-tEEViZXv2I-r88Q,1874
64
+ ara_cli/artefact_models/artefact_model.py,sha256=Ek7CPzYyj5GajoSdb0G8_I9HbBXFAzRq7DB5CEyNZH0,18817
65
+ ara_cli/artefact_models/artefact_templates.py,sha256=u2VxVXIzrC2PKWiHlhwP4pbCQGjacVqcZ8mZTdV2bE0,10042
66
+ ara_cli/artefact_models/businessgoal_artefact_model.py,sha256=GYT5S2xEnQHwv-k-lEeX5NMSqA-UEfV3PhNjgPDUJpw,4698
67
+ ara_cli/artefact_models/capability_artefact_model.py,sha256=SZqHx4O2mj4urn77Stnj4_Jxtlq3-LgBBU9SMkByppI,3079
68
+ ara_cli/artefact_models/epic_artefact_model.py,sha256=_HlFmOJqkDKj3SRpLI4H5rU-va-nFamxhMH4BCODR5c,6053
69
+ ara_cli/artefact_models/example_artefact_model.py,sha256=UXrKbaPotg1jwcrVSdCeo-XH4tTD_-U1e3giaBn5_xg,1384
70
+ ara_cli/artefact_models/feature_artefact_model.py,sha256=PvvZDgwsHV1AMS2FXBxwWxkHFlJ0tyFPRX2NGnbnt1Q,21353
71
+ ara_cli/artefact_models/issue_artefact_model.py,sha256=v6CpKnkqiUh6Wch2kkEmyyW49c8ysdy1qz8l1Ft9uJA,2552
72
+ ara_cli/artefact_models/keyfeature_artefact_model.py,sha256=J9oXLsCAo22AW31D5Z104y02ss0S0O4tPCcd09zYCD0,4066
73
+ ara_cli/artefact_models/serialize_helper.py,sha256=Wks30wy-UrwJURetydKykLgJkdGRgXFHkDT24vHe5tU,595
74
+ ara_cli/artefact_models/task_artefact_model.py,sha256=1BSMbz9D-RXvdpdd0RlAr9hUx84Rcuysk2YfQC8Qy14,6046
75
+ ara_cli/artefact_models/userstory_artefact_model.py,sha256=P5an9UrZ1QrQ57TxSJ48F2OwKxhqEz1B-QxTtHeSZFI,7172
76
+ ara_cli/artefact_models/vision_artefact_model.py,sha256=frjaUJj-mmIlVHEhzAQztCGs-CtvNu_odSborgztfzo,5251
77
+ ara_cli/chat_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
78
+ ara_cli/chat_agent/agent_communicator.py,sha256=Tru2o7LZ0n2iQ1ip01ZFt5d9iwAI6Pcgj6NBK5OF1_A,2349
79
+ ara_cli/chat_agent/agent_process_manager.py,sha256=k_AfG1pr2xbhDVSUm79r5RnOKpdzCvTS3VpUpgIvHUA,7349
80
+ ara_cli/chat_agent/agent_status_manager.py,sha256=CflNgTKjF6MnyiU_5u97LUfpUw9vvAdDm71xFROSupY,2337
81
+ ara_cli/chat_agent/agent_workspace_manager.py,sha256=2Oj8GP6qpme9kTI0Ele3H9VNJr2O6VpuHE8-nsy3LRE,2683
82
+ ara_cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
83
+ ara_cli/commands/command.py,sha256=Y_2dNeuxRjbyI3ScXNv55lptSe8Hs_ya78L0nPYNZHA,154
84
+ ara_cli/commands/extract_command.py,sha256=CzUOwDembG587PYbxg5rge4XSfdsuTyOPUvkobkXCIs,573
85
+ ara_cli/commands/load_command.py,sha256=H3CfeHIL-criDU5oi4BONTSpyzJ4m8DzJ0ZCIiAZFeI,2204
86
+ ara_cli/commands/load_image_command.py,sha256=g9-PXAYdqx5Ed1PdVo-FIb4CyJGEpRFbgQf9Dxg6DmM,886
87
+ ara_cli/commands/read_command.py,sha256=xne8jlertuJNcsyzjR0bJeUUHi4NkEfd0h0DRbU9rC4,4347
88
+ ara_cli/file_loaders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
89
+ ara_cli/file_loaders/binary_file_loader.py,sha256=1HHH1Nk4lEM83CTnf4z9wYz6rMLgpxydFoRcSgkBHmQ,940
90
+ ara_cli/file_loaders/document_file_loader.py,sha256=VxGFChYyM9K-e6eOCK3yk5jQuEXgz01Mh_NoA6CA_RM,1017
91
+ ara_cli/file_loaders/document_reader.py,sha256=SD9_5-XJ6homKUes6o8GWcG--X63UslfAosPbrJZQvo,7721
92
+ ara_cli/file_loaders/document_readers.py,sha256=aG7xrUJwLxWpuFTYlvxzDqoS00Idpvwzt865L0OuQcA,8124
93
+ ara_cli/file_loaders/file_loader.py,sha256=bc1BrMG4pEtwsZLm3Ct53YsMPgnbSaEvZEd8isRDYRY,1711
94
+ ara_cli/file_loaders/file_loaders.py,sha256=9QqArTRDmcUUar58JEr-qnpiAtH9ySP-MV9bvooQNpI,4290
95
+ ara_cli/file_loaders/image_processor.py,sha256=laPThh-i0-obYyS_linQTMcTUwuxMxrSjedGRYb8cIA,3462
96
+ ara_cli/file_loaders/markdown_reader.py,sha256=R-hvvc9Sj9pWwENqJ0j6wrW0eN1tUqEKWcK2YUFsvsU,2542
97
+ ara_cli/file_loaders/text_file_loader.py,sha256=nD0MmjMlr-suMrK7GNwaMd0qv2lJyt4XBijx8SsFvEI,6848
98
+ ara_cli/templates/agile.artefacts,sha256=nTA8dp98HWKAD-0qhmNpVYIfkVGoJshZqMJGnphiOsE,7932
99
+ ara_cli/templates/template.businessgoal.prompt_log.md,sha256=xF6bkgj_GqAAqHxJWJiQNt11mEuSGemIqoZ2wOo6dI0,214
100
+ ara_cli/templates/template.capability.prompt_log.md,sha256=eO8EzrHgb2vYJ-DP1jGzAfDlMo8nY75hZDfhh0s40uQ,208
101
+ ara_cli/templates/template.epic.prompt_log.md,sha256=70MeWRL8Yl64eXwxPFG9KeMeoSziB2O0vv-tYLI8B3g,190
102
+ ara_cli/templates/template.example.prompt_log.md,sha256=PiLVx-tE0FqtLcXMsOvgCFDHIQ0EkOYhZRweJL49kHo,199
103
+ ara_cli/templates/template.feature.prompt_log.md,sha256=8xJUgCnYf18cmlDu90r2mF0039g2QOd38B7ZYg2Aefg,199
104
+ ara_cli/templates/template.issue.prompt_log.md,sha256=dqO26R1xlftqb6nf_BLTEfCZx60yDKqqJZzEluB4Qco,193
105
+ ara_cli/templates/template.keyfeature.prompt_log.md,sha256=VUXZ72Z7KQ9Gp7NR_uWNVa3qSDqFflbNZay_02-X9DY,208
106
+ ara_cli/templates/template.steps.prompt_log.md,sha256=sd8g1KtwgpPvU-vGWAFCDXiWHk6glRQlno5yrRN02_8,193
107
+ ara_cli/templates/template.task.prompt_log.md,sha256=4kAy1zC0k3_y3SoYb-mg3rQEJCW_c43X7ggOLZ321TE,190
108
+ ara_cli/templates/template.userstory.prompt_log.md,sha256=Yp62iF7zDy2XNIwwJN35jKKSmezinK_JKbSvVuagtmA,205
109
+ ara_cli/templates/template.vision.prompt_log.md,sha256=CAzBzj3O23CzrPIUq3xzpXGKn3_nAvyBLRUi-5Bnq_0,196
110
+ ara_cli/templates/prompt-modules/blueprints/empty.blueprint.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
111
+ ara_cli/templates/prompt-modules/blueprints/task_todo_list_C4_architecture_analysis.blueprint.md,sha256=jEZrZaVK_pkRhLp1SpTX3xR6BGXkox6NafXEjX_GDvM,3099
112
+ ara_cli/templates/prompt-modules/commands/architecture_C4_analysis.commands.md,sha256=xzfmOBsETlh90P1haJOiC8y8eLPboZ3yFodbuSUPLBU,1557
113
+ ara_cli/templates/prompt-modules/commands/architecture_radon_cc_score.commands.md,sha256=t-cozhSQPGUOoYfdySBL4n-yQykvCc4s5n0AKpKCn0Q,3074
114
+ ara_cli/templates/prompt-modules/commands/architecture_radon_halstead_v.commands.md,sha256=YBQKZdTJ4QRnBocsWTvT9dmaHOKys1hE0NJC7LPl2vQ,1676
115
+ ara_cli/templates/prompt-modules/commands/architecture_radon_maintainability_score.commands.md,sha256=9nBsY_EYNI9GmD-KzbGKdtEDP4YoY7ECV2QWEzoznfc,5511
116
+ ara_cli/templates/prompt-modules/commands/empty.commands.md,sha256=vgi8-ep2JZBuv0cocpBWJe1-gDzpw1OpHt5KANtaH58,80
117
+ ara_cli/templates/prompt-modules/commands/extract_general.commands.md,sha256=g21jnK5gd0UX8dLv8IpxOX-r5A61EpVgT1VcmxXPcTw,718
118
+ ara_cli/templates/prompt-modules/commands/extract_markdown.commands.md,sha256=em3jFTXNzT5ULdOyFg__DlRciYOTuCXrHiImnJS5B4M,657
119
+ ara_cli/templates/prompt-modules/commands/extract_python.commands.md,sha256=BhTtbfnrr_ABHza0XmGYlQ8YzrESQumyobQj2Ff9dNM,641
120
+ ara_cli/templates/prompt-modules/commands/feature_add_or_modifiy_specified_behavior.commands.md,sha256=vuGfxSifR1UGxUhOQakEYA2KkoK66s_jf2pn6ClHuM0,2444
121
+ ara_cli/templates/prompt-modules/commands/feature_generate_initial_specified_bevahior.commands.md,sha256=oufTleuQcHiYmdzKTtDleMHHN6anw-n8JSpUKUzE7GQ,2810
122
+ ara_cli/templates/prompt-modules/commands/prompt_template_tech_stack_transformer.commands.md,sha256=Z32V1Ux94Uol3gqxqV8V6gdiKSIyrbtd6re7tuLIRsM,4446
123
+ ara_cli/templates/prompt-modules/commands/python_bug_fixing_code.commands.md,sha256=slOySzxZnIXzmIma3jZVvGcNC-llkqlhUil1cuWYE2U,2273
124
+ ara_cli/templates/prompt-modules/commands/python_generate_code.commands.md,sha256=LYNfVuAhtBHB1CDjUqy5Y6dDmq9PVfo8UbJbfB2_mKE,2601
125
+ ara_cli/templates/prompt-modules/commands/python_refactoring_code.commands.md,sha256=p-Y1r10-80Eo7lUmz2hX7uJto8J2-d2C0RMV595t0Sg,2453
126
+ ara_cli/templates/prompt-modules/commands/python_step_definitions_generation_and_fixing.commands.md,sha256=i74lgqMc9KFu9QWfOcZR1jcDMLAZCW4wvGvGRK7Yng0,3204
127
+ ara_cli/templates/prompt-modules/commands/python_unittest_generation_and_fixing.commands.md,sha256=jMuMfOiw_H8RL-I8J5OqBO4rpzYmGgGgzh-kKt_fNkg,3561
128
+ ara_cli/templates/prompt-modules/intentions/classify_task.intention.md,sha256=9ZiEOBFiku24SX4kBJlSCgm5ScYlNZIcNPoHwtGbWIU,254
129
+ ara_cli/templates/prompt-modules/intentions/empty.intention.md,sha256=6dqUtORC992KagZX2Up2yHHvBjVgDTj--wIyYbG4jhc,48
130
+ ara_cli/templates/prompt-modules/intentions/error_fixing.intention.md,sha256=pcfG4csCF830lk8anDCkOA0ewTYnRo5mg0Y0w-fyEJU,206
131
+ ara_cli/templates/prompt-modules/intentions/feature_fix_steps_for_scenario.intention.md,sha256=4rVHzCKvLdSyS4gCoyUEtF0L4BvdBB2UI7dHuhuk4W8,126
132
+ ara_cli/templates/prompt-modules/intentions/feature_formulation.intention.md,sha256=VXQUPM0P-2Pwia_4O7cwy1Iu47ZJTudU2ZzwqvNw7ls,155
133
+ ara_cli/templates/prompt-modules/intentions/feature_reverse_formulation_from_code.intention.md,sha256=iUTiqNT0fe35qrf9vLFOKev_3R232aTKmV8CKj_m0W4,92
134
+ ara_cli/templates/prompt-modules/intentions/feature_scenario_implementation.intention.md,sha256=ZuJoiDFNFnjBFCwOnlZmwRxoVJ1Ie6VHkar7aZH4Wi4,201
135
+ ara_cli/templates/prompt-modules/intentions/feature_scenario_implementation_update.intention.md,sha256=3KF9fD3Co9SjO9msXP0N_UsSuSfdLBGpr3NILfwAnnI,391
136
+ ara_cli/templates/prompt-modules/intentions/feature_scenario_outline_extension.intention.md,sha256=GECphLzX8UbSUmI5aLr_OxdjjPLzwm4-xt6OTIz5xiI,140
137
+ ara_cli/templates/prompt-modules/intentions/feature_update_formulation.intention.md,sha256=US3bo7K5yyXjUHHqA4fTojmUIWTxpmPrDXUv2BckUsQ,163
138
+ ara_cli/templates/prompt-modules/intentions/fibonacci_example_implementation.intention.md,sha256=jGlhS7855wjdcIT6UODNsQ3oFfZY5Nm-Q8VdFQlfBBo,264
139
+ ara_cli/templates/prompt-modules/intentions/js_implementation_from_task_description.intention.md,sha256=Nbg9_ttCAQV4N9f8W_hygkS4Rc47xPbGRC9nZcCDd1Q,207
140
+ ara_cli/templates/prompt-modules/intentions/js_steps_implementation.intention.md,sha256=FcrpA_fbq1N8SUV0BQrk2g23CQ3Z8pjlSzJZtO9mr-A,247
141
+ ara_cli/templates/prompt-modules/intentions/python_cli_implementation_with_test.intention.md,sha256=CmksBiOUlNMXF7Unc7Xmslj8eiVhzEPQc3qNoqIPNRw,215
142
+ ara_cli/templates/prompt-modules/intentions/python_code_understanding.intention.md,sha256=J_kUmSYujLiBTP9l-ALQGdZW3fzO-V2SpYxjq4AsWmM,450
143
+ ara_cli/templates/prompt-modules/intentions/task_implementation.intention.md,sha256=Jgkz4jrq6b8PYhA57HcM_c6sXZC2qThpQiDxB3JMEy8,198
144
+ ara_cli/templates/prompt-modules/intentions/task_prompt_control_by_status.intention.md,sha256=ULzrmeo0Qc_JsxZ-Y_JilKsRRIHzNXrI-Zg_28Yz5PE,750
145
+ ara_cli/templates/prompt-modules/intentions/task_stepwise_implementation_by_number.intention.md,sha256=a36x-q34YllznoalAVuFptvhqOHIBYdD8b0DrLEb-e0,208
146
+ ara_cli/templates/prompt-modules/intentions/task_stepwise_implementation_by_status.intention.md,sha256=Vx9d9GSn4TITbLzf3Okk7rzWoDDqOjxEdlMXPLN4wKE,241
147
+ ara_cli/templates/prompt-modules/rules/architecture_analyst.rules.md,sha256=LX2dqweuoeVKZhTteQYkFdtXI7jsQ5BGYPGU-bhJgwo,4649
148
+ ara_cli/templates/prompt-modules/rules/code_analyst.rules.md,sha256=YQdqcDovuBU6a9r8qVObQDBtDqJhtYL0fRcjs_c8nA8,795
149
+ ara_cli/templates/prompt-modules/rules/empty.rules.md,sha256=LDltJy8-KYHbK9BRhP7FXhOeq8jFTW6GbRAvFiehlDY,71
150
+ ara_cli/templates/prompt-modules/rules/error_analyst.rules.md,sha256=KMSFO-qj5fEqWZZr7GwdyaJNyElfNBlXsy1xu2LEDDA,1054
151
+ ara_cli/templates/prompt-modules/rules/gherkin_expert.rules.md,sha256=lbu839e29GCaw_s3-ENmjSdwf8pRBnAWf8e1JSx8PsE,1077
152
+ ara_cli/templates/prompt-modules/rules/js_expert_developer.rules.md,sha256=KnymLhEZe-TWra-zUXPMA55WZsrJmHq4osVfWHHrZRA,814
153
+ ara_cli/templates/prompt-modules/rules/product_owner.rules.md,sha256=NQYZ0JHOlssk6N_8MD5VEt5Aa-TKoqfzEpUQe9k4FlI,2201
154
+ ara_cli/templates/prompt-modules/rules/python_behave.rules.md,sha256=0CG8S6W-lkLEu0zz2dFwxWCIgZM8QERlk4PCWybTMwA,1257
155
+ ara_cli/templates/prompt-modules/rules/python_developer.rules.md,sha256=XkteyHS8wNdg4Kxtu45ca8q0kXUSBVEpDzqwNdis3fk,600
156
+ ara_cli/templates/specification_breakdown_files/template.concept.exploration.md,sha256=Snti9j5CXMQb0799CQe-4MlLWTcathUVQQJWlvwPXBA,2117
157
+ ara_cli/templates/specification_breakdown_files/template.concept.md,sha256=tyAZojoQF0Xn4BEOtEsT1PZlpPsQSUGsojnvjTqbxks,587
158
+ ara_cli/templates/specification_breakdown_files/template.customer.exploration.md,sha256=mMd66EPkoCzpJH24CfOD5xBrovsdDX6OA_zQi0u8P_g,2273
159
+ ara_cli/templates/specification_breakdown_files/template.customer.md,sha256=gaIhWIfk41e8P5Gpi1PeyIw9MzhiWB7YUgrA5vq4v-w,1460
160
+ ara_cli/templates/specification_breakdown_files/template.persona.exploration.md,sha256=CAJ195w07xWSkNvssgAa_c3ub2f_XCBW0bi_dTns0r8,4183
161
+ ara_cli/templates/specification_breakdown_files/template.persona.md,sha256=ujVzw2gzrr5IW8l4fjl0XjNB-JIKCL-SU20H_8YrVDc,2329
162
+ ara_cli/templates/specification_breakdown_files/template.step.exploration.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
163
+ ara_cli/templates/specification_breakdown_files/template.step.md,sha256=nzDRl9Xo-fJKeDKxIRh9njidV1SOd2ZOPi7eM3YG9DU,1052
164
+ ara_cli/templates/specification_breakdown_files/template.technology.exploration.md,sha256=zQyiJcmbUfXdte-5uZwZUpT6ey0zwfZ00P4VwI97jQk,2274
165
+ ara_cli/templates/specification_breakdown_files/template.technology.md,sha256=bySiksz-8xtq0Nnj4svqe2MgUftWrVkbK9AcrDUE3KY,952
166
+ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
167
+ tests/test_ara_command_action.py,sha256=gLXFAW6K0qCkNKvWvmbshfpJqczvdgBoNGT4rugF7JI,27181
168
+ tests/test_ara_config.py,sha256=RbVhS0SS1lr_SVopEMT1Fake5a-4rWN8MprgJtgI-FA,15883
169
+ tests/test_artefact_autofix.py,sha256=vcN11CY6XJq97N0php4OW-rPbEMEh_nYFISrg-pN1mE,38332
170
+ tests/test_artefact_fuzzy_search.py,sha256=5Sh3_l9QK8-WHn6JpGPU1b6h4QEnl2JoMq1Tdp2cj1U,1261
171
+ tests/test_artefact_link_updater.py,sha256=biqbEp2jCOz8giv72hu2P2hDfeJfJ9OrVGdAv5d9cK4,2191
172
+ tests/test_artefact_lister.py,sha256=35R13UU-YsX1HOsEN8M2-vIiCUA9RSBm6SwestDaFhE,20388
173
+ tests/test_artefact_reader.py,sha256=660K-d8ed-j8hulsUB_7baPD2-hhbg9TffUR5yVc4Uo,927
174
+ tests/test_artefact_renamer.py,sha256=lSnKCCfoFGgKhTdDZrEaeBq1xJAak1QoqH5aSeOe9Ro,3494
175
+ tests/test_artefact_scan.py,sha256=SzMtJeh8_oOBec9yzy3vJRHxs9i1E5gEU2RfF6CJZqE,16888
176
+ tests/test_chat.py,sha256=D2HRRTdnvcDvB9TWz4O91ZONbLJL6w4v8TRTDwjtzzI,86104
177
+ tests/test_classifier.py,sha256=grYGPksydNdPsaEBQxYHZTuTdcJWz7VQtikCKA6BNaQ,1920
178
+ tests/test_directory_navigator.py,sha256=7G0MVrBbtBvbrFUpL0zb_9EkEWi1dulWuHsrQxMJxDY,140
179
+ tests/test_file_classifier.py,sha256=4O1C_iDpGGm35b7aI-HIJd5kkWxFUOrI2n4lEpiDNTM,11855
180
+ tests/test_file_creator.py,sha256=tgBCq6KPv-qMSDhj9AZvQIJABiAqgpFRnEg1fqbVrTI,2013
181
+ tests/test_file_lister.py,sha256=Q9HwhKKx540EPzTmfzOCnvtAgON0aMmpJE2eOe1J3EA,4324
182
+ tests/test_global_file_lister.py,sha256=E-RxGIwxbUsUxadlcFRTAOtgQcnFd-LnKsLzbH9H7ME,5498
183
+ tests/test_list_filter.py,sha256=fJA3d_SdaOAUkE7jn68MOVS0THXGghy1fye_64Zvo1U,7964
184
+ tests/test_prompt_handler.py,sha256=4__q8Ap2hVGXVF1DvvWqq-K630buC7yjccoWkk_FG18,34255
185
+ tests/test_tag_extractor.py,sha256=7eVD10Y1uLkoSrEgqkXzRvPFs8lJ1RiaJzDu7ml_FZE,3118
186
+ tests/test_template_loader.py,sha256=R7s8HJZbKqja-1TRBMBkVKPTgajofUjjRKUJq7a3_Oc,7427
187
+ tests/test_template_manager.py,sha256=qliEeYgAEakn8JIqIHa8u0Ht6DY4L3T6DcHBXkjzR4I,4167
188
+ tests/test_update_config_prompt.py,sha256=xsqj1WTn4BsG5Q2t-sNPfu7EoMURFcS-hfb5VSXUnJc,6765
189
+ ara_cli-0.1.10.8.dist-info/METADATA,sha256=VQnpWRb8ZVtD90Bfmq-rgDa76JdwHtgMSkePRewjGOo,8141
190
+ ara_cli-0.1.10.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
191
+ ara_cli-0.1.10.8.dist-info/entry_points.txt,sha256=v4h7MzysTgSIDYfEo3oj4Kz_8lzsRa3hq-KJHEcLVX8,45
192
+ ara_cli-0.1.10.8.dist-info/top_level.txt,sha256=WM4cLHT5DYUaWzLtRj-gu3yVNFpGQ6lLRI3FMmC-38I,14
193
+ ara_cli-0.1.10.8.dist-info/RECORD,,
@@ -1,5 +1,6 @@
1
1
  import pytest
2
2
  from unittest.mock import patch, MagicMock, call, mock_open
3
+ from ara_cli.error_handler import AraValidationError
3
4
  from ara_cli.ara_command_action import (
4
5
  check_validity,
5
6
  create_action,
@@ -16,6 +17,12 @@ from ara_cli.ara_command_action import (
16
17
  )
17
18
 
18
19
 
20
+ @pytest.fixture
21
+ def mock_handle_errors():
22
+ with patch("ara_cli.ara_command_action.handle_errors", lambda context: (lambda f: f)):
23
+ yield
24
+
25
+
19
26
  @pytest.fixture
20
27
  def mock_dependencies():
21
28
  with patch(
@@ -28,8 +35,10 @@ def mock_dependencies():
28
35
  "ara_cli.template_manager.SpecificationBreakdownAspects"
29
36
  ) as MockSpecificationBreakdownAspects, patch(
30
37
  "ara_cli.artefact_fuzzy_search.find_closest_rule"
31
- ) as mock_find_closest_rule:
32
- yield MockArtefactCreator, MockClassifier, mock_is_valid_filename, MockSpecificationBreakdownAspects, mock_find_closest_rule
38
+ ) as mock_find_closest_rule, patch(
39
+ "ara_cli.artefact_reader.ArtefactReader"
40
+ ) as MockArtefactReader:
41
+ yield MockArtefactCreator, MockClassifier, mock_is_valid_filename, MockSpecificationBreakdownAspects, mock_find_closest_rule, MockArtefactReader
33
42
 
34
43
 
35
44
  @pytest.fixture
@@ -102,65 +111,70 @@ def mock_suggest_close_name_matches():
102
111
  yield mock_suggest_close_name_matches
103
112
 
104
113
 
105
- @pytest.mark.parametrize(
106
- "condition, error_message",
107
- [(True, "This should not be printed"),
108
- (False, "This is a test error message")],
109
- )
110
- def test_check_validity(condition, error_message):
111
- with patch("sys.exit") as mock_exit, patch("builtins.print") as mock_print:
112
- if condition:
113
- check_validity(condition, error_message)
114
- mock_exit.assert_not_called()
115
- mock_print.assert_not_called()
116
- else:
117
- check_validity(condition, error_message)
118
- mock_exit.assert_called_once_with(1)
119
- mock_print.assert_called_once_with(error_message)
114
+ def test_check_validity_with_true_condition():
115
+ """Test that check_validity does nothing when condition is True."""
116
+ # This should not raise any exception
117
+ check_validity(True, "This should not be printed")
120
118
 
121
119
 
122
- @pytest.mark.parametrize(
123
- "classifier_valid, filename_valid",
124
- [(True, True), (False, True), (True, False), (False, False)],
125
- )
126
- def test_create_action_validity_checks(
127
- mock_dependencies, classifier_valid, filename_valid
128
- ):
129
- (
130
- MockArtefactCreator,
131
- MockClassifier,
132
- mock_is_valid_filename,
133
- MockSpecificationBreakdownAspects,
134
- mock_find_closest_rule,
135
- ) = mock_dependencies
120
+ def test_check_validity_with_false_condition():
121
+ """Test that check_validity raises AraValidationError when condition is False."""
122
+ error_message = "This is a test error message"
123
+
124
+ with pytest.raises(AraValidationError, match=error_message):
125
+ check_validity(False, error_message)
126
+
127
+
128
+ def test_check_validity_error_message_content():
129
+ """Test that the raised exception contains the correct error message."""
130
+ error_message = "Custom validation error"
131
+
132
+ with pytest.raises(AraValidationError) as exc_info:
133
+ check_validity(False, error_message)
134
+
135
+ assert str(exc_info.value) == error_message
136
+
137
+
138
+ def setup_create_args_and_mocks(classifier_valid, filename_valid, mock_dependencies):
139
+ (MockArtefactCreator, MockClassifier, mock_is_valid_filename, _, _, MockArtefactReader) = mock_dependencies
136
140
  MockClassifier.is_valid_classifier.return_value = classifier_valid
137
141
  mock_is_valid_filename.return_value = filename_valid
138
- mock_find_closest_rule.return_value = None
142
+ MockArtefactReader.read_artefact.return_value = (None, None)
139
143
 
140
144
  args = MagicMock()
141
145
  args.classifier = "test_classifier"
142
146
  args.parameter = "test_parameter"
147
+ return args
143
148
 
149
+ # Test for valid classifier and filename
150
+ def test_create_action_with_valid_params(mock_handle_errors, mock_dependencies):
151
+ args = setup_create_args_and_mocks(True, True, mock_dependencies)
144
152
  with patch("ara_cli.ara_command_action.check_validity") as mock_check_validity:
145
- if classifier_valid and filename_valid:
146
- create_action(args)
147
- mock_check_validity.assert_any_call(
148
- True, "Invalid classifier provided. Please provide a valid classifier."
149
- )
150
- mock_check_validity.assert_any_call(
151
- True, "Invalid filename provided. Please provide a valid filename."
152
- )
153
- else:
154
- create_action(args)
155
- if not classifier_valid:
156
- mock_check_validity.assert_any_call(
157
- False,
158
- "Invalid classifier provided. Please provide a valid classifier.",
159
- )
160
- if not filename_valid:
161
- mock_check_validity.assert_any_call(
162
- False, "Invalid filename provided. Please provide a valid filename."
163
- )
153
+ create_action(args)
154
+ mock_check_validity.assert_any_call(True, "Invalid classifier provided. Please provide a valid classifier.")
155
+ mock_check_validity.assert_any_call(True, "Invalid filename provided. Please provide a valid filename.")
156
+
157
+ # Test for invalid classifier
158
+ def test_create_action_with_invalid_classifier(mock_handle_errors, mock_dependencies):
159
+ args = setup_create_args_and_mocks(False, True, mock_dependencies)
160
+ with patch("ara_cli.ara_command_action.check_validity") as mock_check_validity:
161
+ create_action(args)
162
+ mock_check_validity.assert_any_call(False, "Invalid classifier provided. Please provide a valid classifier.")
163
+
164
+ # Test for invalid filename
165
+ def test_create_action_with_invalid_filename(mock_handle_errors, mock_dependencies):
166
+ args = setup_create_args_and_mocks(True, False, mock_dependencies)
167
+ with patch("ara_cli.ara_command_action.check_validity") as mock_check_validity:
168
+ create_action(args)
169
+ mock_check_validity.assert_any_call(False, "Invalid filename provided. Please provide a valid filename.")
170
+
171
+ # Test for both invalid classifier and filename
172
+ def test_create_action_with_invalid_classifier_and_filename(mock_handle_errors, mock_dependencies):
173
+ args = setup_create_args_and_mocks(False, False, mock_dependencies)
174
+ with patch("ara_cli.ara_command_action.check_validity") as mock_check_validity:
175
+ create_action(args)
176
+ mock_check_validity.assert_any_call(False, "Invalid classifier provided. Please provide a valid classifier.")
177
+ mock_check_validity.assert_any_call(False, "Invalid filename provided. Please provide a valid filename.")
164
178
 
165
179
 
166
180
  @pytest.mark.parametrize(
@@ -406,7 +420,7 @@ def test_read_status_action(classifier, artefact_name, artefact_exists, status,
406
420
  # Verify behavior
407
421
  if not artefact_exists:
408
422
  # Should suggest close matches when artefact not found
409
- mock_suggest_close_name_matches.assert_called_once_with(artefact_name, all_artefact_names)
423
+ mock_suggest_close_name_matches.assert_called_once_with(artefact_name, all_artefact_names, report_as_error=True)
410
424
  mock_open.assert_not_called()
411
425
  else:
412
426
  # Should open the file and read content
@@ -439,7 +453,7 @@ def read_user_action(args):
439
453
  lambda x: x["title"] == artefact_name, artefact_info_dicts
440
454
  ))
441
455
 
442
- with open(artefact_info["file_path"], 'r') as file:
456
+ with open(artefact_info["file_path"], 'r', encoding='utf-8') as file:
443
457
  content = file.read()
444
458
  artefact = artefact_from_content(content)
445
459
 
@@ -514,8 +528,8 @@ def test_set_status_action(classifier, artefact_name, artefact_names, new_status
514
528
 
515
529
  # Verify the file was opened for reading and writing
516
530
  expected_file_path = next(info["file_path"] for info in artefact_info_dicts if info["title"] == artefact_name)
517
- mock_open.assert_any_call(expected_file_path, 'r')
518
- mock_open.assert_any_call(expected_file_path, 'w')
531
+ mock_open.assert_any_call(expected_file_path, 'r', encoding='utf-8')
532
+ mock_open.assert_any_call(expected_file_path, 'w', encoding='utf-8')
519
533
 
520
534
  # Verify the serialized content was written
521
535
  mock_file_handle.__enter__.return_value.write.assert_called_once_with("serialized_content")
@@ -593,14 +607,14 @@ def test_set_user_action(
593
607
  else:
594
608
  # Should open the file and read content
595
609
  expected_file_path = next(info["file_path"] for info in artefact_info_dicts if info["title"] == artefact_name)
596
- mock_open.assert_any_call(expected_file_path, 'r')
610
+ mock_open.assert_any_call(expected_file_path, 'r', encoding='utf-8')
597
611
  mock_artefact_from_content.assert_called_once_with(mock_file_content)
598
612
 
599
613
  # Should set the users attribute on the artefact
600
614
  assert mock_artefact.users == [new_user.lstrip('@') if new_user.startswith('@') else new_user]
601
615
 
602
616
  # Should write the serialized content back to the file
603
- mock_open.assert_any_call(expected_file_path, 'w')
617
+ mock_open.assert_any_call(expected_file_path, 'w', encoding='utf-8')
604
618
  mock_file_handle.__enter__.return_value.write.assert_called_once_with("serialized_content")
605
619
 
606
620
  # Should print a success message
@@ -655,7 +669,7 @@ def test_scan_action_with_issues(capsys):
655
669
  "\t\treason1\n"
656
670
  )
657
671
  assert captured.out == expected_output
658
- m.assert_called_once_with("incompatible_artefacts_report.md", "w")
672
+ m.assert_called_once_with("incompatible_artefacts_report.md", "w", encoding="utf-8")
659
673
  handle = m()
660
674
  expected_writes = [
661
675
  call("# Artefact Check Report\n\n"),
@@ -684,7 +698,7 @@ def test_scan_action_all_good(capsys):
684
698
 
685
699
  captured = capsys.readouterr()
686
700
  assert captured.out == "All files are good!\n"
687
- m.assert_called_once_with("incompatible_artefacts_report.md", "w")
701
+ m.assert_called_once_with("incompatible_artefacts_report.md", "w", encoding="utf-8")
688
702
  handle = m()
689
703
  handle.write.assert_has_calls([
690
704
  call("# Artefact Check Report\n\n"),