ara-cli 0.1.9.51__py3-none-any.whl → 0.1.9.53__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.
- ara_cli/ara_command_action.py +34 -34
- ara_cli/ara_config.py +2 -7
- ara_cli/artefact_creator.py +3 -4
- ara_cli/artefact_lister.py +11 -13
- ara_cli/artefact_models/artefact_model.py +20 -8
- ara_cli/artefact_reader.py +10 -16
- ara_cli/artefact_renamer.py +8 -8
- ara_cli/chat.py +2 -1
- ara_cli/file_classifier.py +3 -33
- ara_cli/tests/test_ara_command_action.py +6 -6
- ara_cli/tests/test_artefact_lister.py +149 -91
- ara_cli/tests/test_artefact_reader.py +2 -43
- ara_cli/tests/test_chat.py +18 -13
- ara_cli/tests/test_file_classifier.py +2 -2
- ara_cli/version.py +1 -1
- {ara_cli-0.1.9.51.dist-info → ara_cli-0.1.9.53.dist-info}/METADATA +1 -1
- {ara_cli-0.1.9.51.dist-info → ara_cli-0.1.9.53.dist-info}/RECORD +20 -22
- ara_cli/artefact.py +0 -172
- ara_cli/tests/test_artefact.py +0 -304
- {ara_cli-0.1.9.51.dist-info → ara_cli-0.1.9.53.dist-info}/WHEEL +0 -0
- {ara_cli-0.1.9.51.dist-info → ara_cli-0.1.9.53.dist-info}/entry_points.txt +0 -0
- {ara_cli-0.1.9.51.dist-info → ara_cli-0.1.9.53.dist-info}/top_level.txt +0 -0
|
@@ -2,7 +2,6 @@ import pytest
|
|
|
2
2
|
from unittest.mock import MagicMock, patch
|
|
3
3
|
from ara_cli.artefact_lister import ArtefactLister
|
|
4
4
|
from ara_cli.list_filter import ListFilter
|
|
5
|
-
from ara_cli.artefact_models.artefact_model import ArtefactType
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
@pytest.fixture
|
|
@@ -313,7 +312,7 @@ def test_list_children(
|
|
|
313
312
|
# Configure mock FileClassifier
|
|
314
313
|
mock_classifier_instance = MagicMock()
|
|
315
314
|
mock_file_classifier.return_value = mock_classifier_instance
|
|
316
|
-
mock_classifier_instance.
|
|
315
|
+
mock_classifier_instance.classify_files.return_value = classified_artefacts
|
|
317
316
|
|
|
318
317
|
# Configure ArtefactReader mock
|
|
319
318
|
mock_artefact_reader.find_children.return_value = child_artefacts
|
|
@@ -325,7 +324,7 @@ def test_list_children(
|
|
|
325
324
|
artefact_lister.list_children(classifier, artefact_name, list_filter)
|
|
326
325
|
|
|
327
326
|
# Verify interactions
|
|
328
|
-
mock_classifier_instance.
|
|
327
|
+
mock_classifier_instance.classify_files.assert_called_once()
|
|
329
328
|
|
|
330
329
|
# Check if suggestions were made for non-existent artefacts
|
|
331
330
|
if not matching_artefacts:
|
|
@@ -423,7 +422,7 @@ def test_list_branch(
|
|
|
423
422
|
# Configure mock FileClassifier
|
|
424
423
|
mock_classifier_instance = MagicMock()
|
|
425
424
|
mock_file_classifier.return_value = mock_classifier_instance
|
|
426
|
-
mock_classifier_instance.
|
|
425
|
+
mock_classifier_instance.classify_files.return_value = classified_artefacts
|
|
427
426
|
|
|
428
427
|
# Mock step_through_value_chain to modify the provided dictionary
|
|
429
428
|
def mock_step_through(artefact_name, classifier, artefacts_by_classifier):
|
|
@@ -441,7 +440,7 @@ def test_list_branch(
|
|
|
441
440
|
|
|
442
441
|
# Verify interactions
|
|
443
442
|
mock_file_classifier.assert_called_once_with(mock_os)
|
|
444
|
-
mock_classifier_instance.
|
|
443
|
+
mock_classifier_instance.classify_files.assert_called_once()
|
|
445
444
|
|
|
446
445
|
# Check if suggestions were made for non-existent artefacts
|
|
447
446
|
if not matching_artefacts:
|
|
@@ -470,104 +469,163 @@ def test_list_branch(
|
|
|
470
469
|
)
|
|
471
470
|
|
|
472
471
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
"Epic1",
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
True
|
|
485
|
-
),
|
|
486
|
-
# Case 2: Artefact found, data directory exists, with filter
|
|
487
|
-
(
|
|
488
|
-
"userstory",
|
|
489
|
-
"Story1",
|
|
490
|
-
ListFilter(include_tags=["tag1"]),
|
|
491
|
-
{"userstory": ["path/to/Story1.userstory", "path/to/Story2.userstory"]},
|
|
492
|
-
["path/to/Story1.userstory", "path/to/Story2.userstory"],
|
|
493
|
-
["path/to/Story1.userstory"],
|
|
494
|
-
True
|
|
495
|
-
),
|
|
496
|
-
# Case 3: Artefact found, data directory doesn't exist
|
|
497
|
-
(
|
|
498
|
-
"epic",
|
|
499
|
-
"Epic1",
|
|
500
|
-
None,
|
|
501
|
-
{"epic": ["path/to/Epic1.epic", "path/to/Epic2.epic"]},
|
|
502
|
-
["path/to/Epic1.epic", "path/to/Epic2.epic"],
|
|
503
|
-
["path/to/Epic1.epic"],
|
|
504
|
-
False
|
|
505
|
-
),
|
|
506
|
-
# Case 4: Artefact not found
|
|
507
|
-
(
|
|
508
|
-
"epic",
|
|
509
|
-
"NonExistentEpic",
|
|
510
|
-
None,
|
|
511
|
-
{"epic": ["path/to/Epic1.epic", "path/to/Epic2.epic"]},
|
|
512
|
-
["path/to/Epic1.epic", "path/to/Epic2.epic"],
|
|
513
|
-
[],
|
|
514
|
-
False
|
|
515
|
-
),
|
|
516
|
-
# Case 5: Empty artefact list
|
|
517
|
-
(
|
|
518
|
-
"epic",
|
|
519
|
-
"Epic1",
|
|
520
|
-
None,
|
|
521
|
-
{"epic": []},
|
|
522
|
-
[],
|
|
523
|
-
[],
|
|
524
|
-
False
|
|
525
|
-
),
|
|
526
|
-
],
|
|
527
|
-
)
|
|
528
|
-
def test_list_data(
|
|
529
|
-
artefact_lister,
|
|
530
|
-
classifier,
|
|
531
|
-
artefact_name,
|
|
532
|
-
list_filter,
|
|
533
|
-
classified_artefacts,
|
|
534
|
-
artefact_paths,
|
|
535
|
-
matching_paths,
|
|
536
|
-
data_dir_exists,
|
|
537
|
-
):
|
|
538
|
-
# Setup mocks
|
|
472
|
+
def test_list_data_artefact_found_data_exists(artefact_lister):
|
|
473
|
+
classifier = "epic"
|
|
474
|
+
artefact_name = "Epic1"
|
|
475
|
+
list_filter = None
|
|
476
|
+
classified_artefacts = {
|
|
477
|
+
"epic": [
|
|
478
|
+
{"title": "Epic1", "file_path": "path/to/Epic1.epic"},
|
|
479
|
+
{"title": "Epic2", "file_path": "path/to/Epic2.epic"}
|
|
480
|
+
]
|
|
481
|
+
}
|
|
482
|
+
|
|
539
483
|
with patch("ara_cli.artefact_lister.FileClassifier") as mock_file_classifier, \
|
|
540
484
|
patch("ara_cli.artefact_lister.suggest_close_name_matches") as mock_suggest, \
|
|
541
485
|
patch("ara_cli.artefact_lister.os") as mock_os, \
|
|
542
486
|
patch("ara_cli.artefact_lister.list_files_in_directory") as mock_list_files:
|
|
543
487
|
|
|
544
|
-
# Configure
|
|
488
|
+
# Configure mocks
|
|
489
|
+
mock_classifier_instance = MagicMock()
|
|
490
|
+
mock_file_classifier.return_value = mock_classifier_instance
|
|
491
|
+
mock_classifier_instance.classify_files.return_value = classified_artefacts
|
|
492
|
+
|
|
493
|
+
mock_os.path.splitext.return_value = ("path/to/Epic1", ".epic")
|
|
494
|
+
mock_os.path.exists.return_value = True
|
|
495
|
+
|
|
496
|
+
# Call the method under test
|
|
497
|
+
artefact_lister.list_data(classifier, artefact_name, list_filter)
|
|
498
|
+
|
|
499
|
+
# Verify interactions
|
|
500
|
+
mock_suggest.assert_not_called()
|
|
501
|
+
mock_os.path.splitext.assert_called_with("path/to/Epic1.epic")
|
|
502
|
+
mock_os.path.exists.assert_called_with("path/to/Epic1.data")
|
|
503
|
+
mock_list_files.assert_called_once_with("path/to/Epic1.data", list_filter)
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
def test_list_data_artefact_found_data_not_exists(artefact_lister):
|
|
507
|
+
classifier = "epic"
|
|
508
|
+
artefact_name = "Epic1"
|
|
509
|
+
list_filter = None
|
|
510
|
+
classified_artefacts = {
|
|
511
|
+
"epic": [
|
|
512
|
+
{"title": "Epic1", "file_path": "path/to/Epic1.epic"},
|
|
513
|
+
{"title": "Epic2", "file_path": "path/to/Epic2.epic"}
|
|
514
|
+
]
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
with patch("ara_cli.artefact_lister.FileClassifier") as mock_file_classifier, \
|
|
518
|
+
patch("ara_cli.artefact_lister.suggest_close_name_matches") as mock_suggest, \
|
|
519
|
+
patch("ara_cli.artefact_lister.os") as mock_os, \
|
|
520
|
+
patch("ara_cli.artefact_lister.list_files_in_directory") as mock_list_files:
|
|
521
|
+
|
|
522
|
+
# Configure mocks
|
|
545
523
|
mock_classifier_instance = MagicMock()
|
|
546
524
|
mock_file_classifier.return_value = mock_classifier_instance
|
|
547
525
|
mock_classifier_instance.classify_files.return_value = classified_artefacts
|
|
526
|
+
|
|
527
|
+
mock_os.path.splitext.return_value = ("path/to/Epic1", ".epic")
|
|
528
|
+
mock_os.path.exists.return_value = False
|
|
548
529
|
|
|
549
|
-
#
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
530
|
+
# Call the method under test
|
|
531
|
+
artefact_lister.list_data(classifier, artefact_name, list_filter)
|
|
532
|
+
|
|
533
|
+
# Verify interactions
|
|
534
|
+
mock_suggest.assert_not_called()
|
|
535
|
+
mock_os.path.splitext.assert_called_with("path/to/Epic1.epic")
|
|
536
|
+
mock_os.path.exists.assert_called_with("path/to/Epic1.data")
|
|
537
|
+
mock_list_files.assert_not_called()
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
def test_list_data_artefact_not_found(artefact_lister):
|
|
541
|
+
classifier = "epic"
|
|
542
|
+
artefact_name = "NonExistentEpic"
|
|
543
|
+
list_filter = None
|
|
544
|
+
classified_artefacts = {
|
|
545
|
+
"epic": [
|
|
546
|
+
{"title": "Epic1", "file_path": "path/to/Epic1.epic"},
|
|
547
|
+
{"title": "Epic2", "file_path": "path/to/Epic2.epic"}
|
|
548
|
+
]
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
with patch("ara_cli.artefact_lister.FileClassifier") as mock_file_classifier, \
|
|
552
|
+
patch("ara_cli.artefact_lister.suggest_close_name_matches") as mock_suggest, \
|
|
553
|
+
patch("ara_cli.artefact_lister.os") as mock_os, \
|
|
554
|
+
patch("ara_cli.artefact_lister.list_files_in_directory") as mock_list_files:
|
|
555
|
+
|
|
556
|
+
# Configure mocks
|
|
557
|
+
mock_classifier_instance = MagicMock()
|
|
558
|
+
mock_file_classifier.return_value = mock_classifier_instance
|
|
559
|
+
mock_classifier_instance.classify_files.return_value = classified_artefacts
|
|
553
560
|
|
|
554
561
|
# Call the method under test
|
|
555
562
|
artefact_lister.list_data(classifier, artefact_name, list_filter)
|
|
556
563
|
|
|
557
564
|
# Verify interactions
|
|
558
|
-
|
|
559
|
-
|
|
565
|
+
mock_suggest.assert_called_once_with(
|
|
566
|
+
artefact_name,
|
|
567
|
+
["Epic1", "Epic2"]
|
|
568
|
+
)
|
|
569
|
+
mock_os.path.splitext.assert_not_called()
|
|
570
|
+
mock_os.path.exists.assert_not_called()
|
|
571
|
+
mock_list_files.assert_not_called()
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
def test_list_data_with_filter(artefact_lister):
|
|
575
|
+
classifier = "userstory"
|
|
576
|
+
artefact_name = "Story1"
|
|
577
|
+
list_filter = ListFilter(include_tags=["tag1"])
|
|
578
|
+
classified_artefacts = {
|
|
579
|
+
"userstory": [
|
|
580
|
+
{"title": "Story1", "file_path": "path/to/Story1.userstory"},
|
|
581
|
+
{"title": "Story2", "file_path": "path/to/Story2.userstory"}
|
|
582
|
+
]
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
with patch("ara_cli.artefact_lister.FileClassifier") as mock_file_classifier, \
|
|
586
|
+
patch("ara_cli.artefact_lister.suggest_close_name_matches") as mock_suggest, \
|
|
587
|
+
patch("ara_cli.artefact_lister.os") as mock_os, \
|
|
588
|
+
patch("ara_cli.artefact_lister.list_files_in_directory") as mock_list_files:
|
|
560
589
|
|
|
561
|
-
#
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
590
|
+
# Configure mocks
|
|
591
|
+
mock_classifier_instance = MagicMock()
|
|
592
|
+
mock_file_classifier.return_value = mock_classifier_instance
|
|
593
|
+
mock_classifier_instance.classify_files.return_value = classified_artefacts
|
|
594
|
+
|
|
595
|
+
mock_os.path.splitext.return_value = ("path/to/Story1", ".userstory")
|
|
596
|
+
mock_os.path.exists.return_value = True
|
|
597
|
+
|
|
598
|
+
# Call the method under test
|
|
599
|
+
artefact_lister.list_data(classifier, artefact_name, list_filter)
|
|
600
|
+
|
|
601
|
+
# Verify interactions
|
|
602
|
+
mock_suggest.assert_not_called()
|
|
603
|
+
mock_os.path.splitext.assert_called_with("path/to/Story1.userstory")
|
|
604
|
+
mock_os.path.exists.assert_called_with("path/to/Story1.data")
|
|
605
|
+
mock_list_files.assert_called_once_with("path/to/Story1.data", list_filter)
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
def test_list_data_empty_artefact_list(artefact_lister):
|
|
609
|
+
classifier = "epic"
|
|
610
|
+
artefact_name = "Epic1"
|
|
611
|
+
list_filter = None
|
|
612
|
+
classified_artefacts = {"epic": []}
|
|
613
|
+
|
|
614
|
+
with patch("ara_cli.artefact_lister.FileClassifier") as mock_file_classifier, \
|
|
615
|
+
patch("ara_cli.artefact_lister.suggest_close_name_matches") as mock_suggest, \
|
|
616
|
+
patch("ara_cli.artefact_lister.os") as mock_os, \
|
|
617
|
+
patch("ara_cli.artefact_lister.list_files_in_directory") as mock_list_files:
|
|
618
|
+
|
|
619
|
+
# Configure mocks
|
|
620
|
+
mock_classifier_instance = MagicMock()
|
|
621
|
+
mock_file_classifier.return_value = mock_classifier_instance
|
|
622
|
+
mock_classifier_instance.classify_files.return_value = classified_artefacts
|
|
623
|
+
|
|
624
|
+
# Call the method under test
|
|
625
|
+
artefact_lister.list_data(classifier, artefact_name, list_filter)
|
|
626
|
+
|
|
627
|
+
# Verify interactions
|
|
628
|
+
mock_suggest.assert_called_once_with(artefact_name, [])
|
|
629
|
+
mock_os.path.splitext.assert_not_called()
|
|
630
|
+
mock_os.path.exists.assert_not_called()
|
|
631
|
+
mock_list_files.assert_not_called()
|
|
@@ -1,48 +1,7 @@
|
|
|
1
1
|
import pytest
|
|
2
|
-
from unittest.mock import patch
|
|
2
|
+
from unittest.mock import patch
|
|
3
3
|
from ara_cli.artefact_reader import ArtefactReader
|
|
4
|
-
from ara_cli.artefact import Artefact
|
|
5
4
|
|
|
6
|
-
@pytest.mark.parametrize("artefact_name, classifier, is_valid, file_paths, expected_output, should_suggest", [
|
|
7
|
-
("artefact1", "example", True, ["/example/artefact1.example"], ("file content", "/example/artefact1.example"), False),
|
|
8
|
-
("artefact2", "invalid_classifier", False, ["/invalid_classifier/artefact2.invalid_classifier"], None, False),
|
|
9
|
-
("artefact3", "example", True, [], None, True),
|
|
10
|
-
])
|
|
11
|
-
def test_read_artefact(artefact_name, classifier, is_valid, file_paths, expected_output, should_suggest):
|
|
12
|
-
original_directory = "/original/directory"
|
|
13
|
-
|
|
14
|
-
with patch('os.getcwd', return_value=original_directory), \
|
|
15
|
-
patch('os.chdir') as mock_chdir, \
|
|
16
|
-
patch('ara_cli.directory_navigator.DirectoryNavigator.navigate_to_target'), \
|
|
17
|
-
patch('ara_cli.classifier.Classifier.is_valid_classifier', return_value=is_valid), \
|
|
18
|
-
patch('ara_cli.file_classifier.FileClassifier.classify_files', return_value={classifier: file_paths}), \
|
|
19
|
-
patch('builtins.open', mock_open(read_data="file content")) as mock_file, \
|
|
20
|
-
patch('ara_cli.artefact_fuzzy_search.suggest_close_name_matches') as mock_suggest:
|
|
21
|
-
|
|
22
|
-
if expected_output is None:
|
|
23
|
-
expected_content, expected_file_path = None, None
|
|
24
|
-
else:
|
|
25
|
-
expected_content, expected_file_path = expected_output
|
|
26
|
-
|
|
27
|
-
content, file_path = ArtefactReader.read_artefact(artefact_name, classifier)
|
|
28
|
-
|
|
29
|
-
# Check if the content and file path match expected output
|
|
30
|
-
assert content == expected_content
|
|
31
|
-
assert file_path == expected_file_path
|
|
32
|
-
|
|
33
|
-
# Check the directory was changed back to original
|
|
34
|
-
mock_chdir.assert_called_with(original_directory)
|
|
35
|
-
|
|
36
|
-
if not is_valid:
|
|
37
|
-
mock_file.assert_not_called()
|
|
38
|
-
mock_suggest.assert_not_called() # Suggestion would not be called for invalid classifier
|
|
39
|
-
elif not file_paths:
|
|
40
|
-
mock_file.assert_not_called()
|
|
41
|
-
if not should_suggest:
|
|
42
|
-
mock_suggest.assert_not_called()
|
|
43
|
-
else:
|
|
44
|
-
mock_file.assert_called_once_with(expected_file_path, 'r')
|
|
45
|
-
mock_suggest.assert_not_called() # Suggestion should not be called if a valid artefact is found
|
|
46
5
|
|
|
47
6
|
@pytest.mark.parametrize("artefact_content, artefact_titles, expected_output", [
|
|
48
7
|
("Contributes to: parent_name Example", ["Example"], ("parent_name", "Example")),
|
|
@@ -54,4 +13,4 @@ def test_read_artefact(artefact_name, classifier, is_valid, file_paths, expected
|
|
|
54
13
|
def test_extract_parent_tree(artefact_content, artefact_titles, expected_output):
|
|
55
14
|
with patch('ara_cli.classifier.Classifier.artefact_titles', return_value=artefact_titles):
|
|
56
15
|
parent_name, parent_type = ArtefactReader.extract_parent_tree(artefact_content)
|
|
57
|
-
assert (parent_name, parent_type) == expected_output
|
|
16
|
+
assert (parent_name, parent_type) == expected_output
|
ara_cli/tests/test_chat.py
CHANGED
|
@@ -930,20 +930,24 @@ def test_do_LOAD_COMMANDS(monkeypatch, temp_chat_file, commands_name, expected_d
|
|
|
930
930
|
mock_load_template_helper.assert_called_once_with(commands_name, "commands", "*.commands.md")
|
|
931
931
|
|
|
932
932
|
|
|
933
|
-
@pytest.mark.parametrize("template_name, template_type, default_pattern, expected_directory, expected_pattern", [
|
|
934
|
-
("global/test_command", "commands", "*.commands.md", "mocked_template_base_path/prompt-modules/commands/", "test_command"),
|
|
935
|
-
("local_command", "commands", "*.commands.md", "/project/mocked_local_templates_path/custom-prompt-modules/commands", "local_command"),
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
("
|
|
939
|
-
|
|
940
|
-
("
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
("
|
|
944
|
-
("
|
|
933
|
+
@pytest.mark.parametrize("template_name, template_type, default_pattern, custom_template_subdir, expected_directory, expected_pattern", [
|
|
934
|
+
("global/test_command", "commands", "*.commands.md", "mocked_custom_modules_path", "mocked_template_base_path/prompt-modules/commands/", "test_command"),
|
|
935
|
+
("local_command", "commands", "*.commands.md", "custom-prompt-modules", "/project/mocked_local_templates_path/custom-prompt-modules/commands", "local_command"),
|
|
936
|
+
("local_command", "commands", "*.commands.md", "mocked_custom_modules_path", "/project/mocked_local_templates_path/mocked_custom_modules_path/commands", "local_command"),
|
|
937
|
+
|
|
938
|
+
("global/test_rule", "rules", "*.rules.md", "mocked_custom_modules_path", "mocked_template_base_path/prompt-modules/rules/", "test_rule"),
|
|
939
|
+
("local_rule", "rules", "*.rules.md", "custom-prompt-modules", "/project/mocked_local_templates_path/custom-prompt-modules/rules", "local_rule"),
|
|
940
|
+
("local_rule", "rules", "*.rules.md", "mocked_custom_modules_path", "/project/mocked_local_templates_path/mocked_custom_modules_path/rules", "local_rule"),
|
|
941
|
+
|
|
942
|
+
("global/test_intention", "intention", "*.intentions.md", "mocked_custom_modules_path", "mocked_template_base_path/prompt-modules/intentions/", "test_intention"),
|
|
943
|
+
("local_intention", "intention", "*.intentions.md", "custom-prompt-modules", "/project/mocked_local_templates_path/custom-prompt-modules/intentions", "local_intention"),
|
|
944
|
+
("local_intention", "intention", "*.intentions.md", "mocked_custom_modules_path", "/project/mocked_local_templates_path/mocked_custom_modules_path/intentions", "local_intention"),
|
|
945
|
+
|
|
946
|
+
("global/test_blueprint", "blueprint", "*.blueprints.md", "mocked_custom_modules_path", "mocked_template_base_path/prompt-modules/blueprints/", "test_blueprint"),
|
|
947
|
+
("local_blueprint", "blueprint", "*.blueprints.md", "custom-prompt-modules", "/project/mocked_local_templates_path/custom-prompt-modules/blueprints", "local_blueprint"),
|
|
948
|
+
("local_blueprint", "blueprint", "*.blueprints.md", "mocked_custom_modules_path", "/project/mocked_local_templates_path/mocked_custom_modules_path/blueprints", "local_blueprint")
|
|
945
949
|
])
|
|
946
|
-
def test_load_template_from_global_or_local(monkeypatch, temp_chat_file, template_name, template_type, default_pattern, expected_directory, expected_pattern):
|
|
950
|
+
def test_load_template_from_global_or_local(monkeypatch, temp_chat_file, template_name, template_type, default_pattern, custom_template_subdir, expected_directory, expected_pattern):
|
|
947
951
|
mock_config = get_default_config()
|
|
948
952
|
with patch('ara_cli.prompt_handler.ConfigManager.get_config', return_value=mock_config):
|
|
949
953
|
chat = Chat(temp_chat_file.name, reset=False)
|
|
@@ -956,6 +960,7 @@ def test_load_template_from_global_or_local(monkeypatch, temp_chat_file, templat
|
|
|
956
960
|
|
|
957
961
|
config = chat.config
|
|
958
962
|
config.local_prompt_templates_dir = mock_local_templates_path
|
|
963
|
+
config.custom_prompt_templates_subdir = custom_template_subdir
|
|
959
964
|
chat.config = config
|
|
960
965
|
|
|
961
966
|
with patch.object(chat, '_load_helper') as mock_load_helper:
|
|
@@ -198,7 +198,7 @@ def test_classify_files(mock_file_system, mock_classifier, walk_return_value, cl
|
|
|
198
198
|
classifier = FileClassifier(mock_file_system)
|
|
199
199
|
|
|
200
200
|
with patch.object(classifier, 'classify_file', side_effect=classify_file_side_effect):
|
|
201
|
-
result = classifier.
|
|
201
|
+
result = classifier.classify_files()
|
|
202
202
|
|
|
203
203
|
assert result == expected_result
|
|
204
204
|
|
|
@@ -232,7 +232,7 @@ def test_print_classified_files(mock_file_system, mock_classifier, mock_get_arte
|
|
|
232
232
|
def test_find_closest_artefact_name_match(mock_file_system):
|
|
233
233
|
classifier = FileClassifier(mock_file_system)
|
|
234
234
|
classifier.classify_files = MagicMock(return_value={
|
|
235
|
-
'py': ['file1', 'file2'],
|
|
235
|
+
'py': [{'title': 'file1'}, {'title': 'file2'}],
|
|
236
236
|
'txt': []
|
|
237
237
|
})
|
|
238
238
|
|
ara_cli/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# version.py
|
|
2
|
-
__version__ = "0.1.9.
|
|
2
|
+
__version__ = "0.1.9.53" # fith parameter like .0 for local install test purposes only. official numbers should be 4 digit numbers
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
ara_cli/__init__.py,sha256=0zl7IegxTid26EBGLav_fXZ4CCIV3H5TfAoFQiOHjvg,148
|
|
2
2
|
ara_cli/__main__.py,sha256=3fYaQUcudgjqtJa2gj2LoYnhy-Wy1OfZIfXEYQf4m0U,1806
|
|
3
3
|
ara_cli/analyse_artefacts.py,sha256=JwA2zxkCy8vNOHoU9f3TICJesXRRXndHi2hT5m_uQ8Q,4965
|
|
4
|
-
ara_cli/ara_command_action.py,sha256=
|
|
4
|
+
ara_cli/ara_command_action.py,sha256=axyDx6Wj2IDP_gXFtMbuBsVQBYc8_dLCed1FntwwuAA,18784
|
|
5
5
|
ara_cli/ara_command_parser.py,sha256=wbuPElD9GSDpaxHRH3yoyKaLAYsk6n9lE78jERD2zXg,16770
|
|
6
|
-
ara_cli/ara_config.py,sha256=
|
|
7
|
-
ara_cli/
|
|
8
|
-
ara_cli/artefact_creator.py,sha256=psFVpP_YQpCUwCf5WkzY5yiCslzcFcBPWKLGYbz7iU0,6046
|
|
6
|
+
ara_cli/ara_config.py,sha256=_Arkr-b9XnrNHbBlFKb9tAo3OmdP4ZZiWvbY9m6Sbo0,4178
|
|
7
|
+
ara_cli/artefact_creator.py,sha256=s0hY8-X0EAwEfZvIRK1F67bW55tB-EvgnvH2gYNTGpY,6022
|
|
9
8
|
ara_cli/artefact_deleter.py,sha256=Co4wwCH3yW8H9NrOq7_2p5571EeHr0TsfE-H8KqoOfY,1900
|
|
10
9
|
ara_cli/artefact_fuzzy_search.py,sha256=sDxHKfg6P5TIiwznFgrMuMMhDp6EKElCbZsfflmkCww,1339
|
|
11
10
|
ara_cli/artefact_link_updater.py,sha256=itMS_Z64jE8bBly9WA01z8PqkBeNW6ntTO7ryMeCTRg,3703
|
|
12
|
-
ara_cli/artefact_lister.py,sha256=
|
|
13
|
-
ara_cli/artefact_reader.py,sha256=
|
|
14
|
-
ara_cli/artefact_renamer.py,sha256=
|
|
11
|
+
ara_cli/artefact_lister.py,sha256=jhk4n4eqp7hDIq07q43QzS7-36BM3OfZ4EABxCeOGcw,4764
|
|
12
|
+
ara_cli/artefact_reader.py,sha256=qNaMPWShmWtDU5LLdh9efFB27djI4NAoq6zEFwdTd38,6983
|
|
13
|
+
ara_cli/artefact_renamer.py,sha256=U0cwkR6j1KVjz1LRqiHa11sqFCSyi_GaG5AWJHoLOx0,4009
|
|
15
14
|
ara_cli/artefact_scan.py,sha256=DgFGv4hnbCjYdIgPA2PbAuGDWg1q2fCjtIqxGs57b9w,1762
|
|
16
|
-
ara_cli/chat.py,sha256=
|
|
15
|
+
ara_cli/chat.py,sha256=7xTtPEDk052_wmIzoti7GavEJ1vpRxe5c084WQ1C7dg,28617
|
|
17
16
|
ara_cli/classifier.py,sha256=zWskj7rBYdqYBGjksBm46iTgVU5IIf2PZsJr4qeiwVU,1878
|
|
18
17
|
ara_cli/codefusionretriever.py,sha256=fCHgXdIBRzkVAnapX-KI2NQ44XbrrF4tEQmn5J6clUI,1980
|
|
19
18
|
ara_cli/codehierachieretriever.py,sha256=Xd3EgEWWhkSf1TmTWtf8X5_YvyE_4B66nRrqarwSiTU,1182
|
|
20
19
|
ara_cli/commandline_completer.py,sha256=b00Dqb5n7SecpxYIDLxAfYhp8X6e3c8a5qYz6ko0i3E,1192
|
|
21
20
|
ara_cli/directory_navigator.py,sha256=6QbSAjJrJ5a6Lutol9J4HFgVDMiAQ672ny9TATrh04U,3318
|
|
22
|
-
ara_cli/file_classifier.py,sha256=
|
|
21
|
+
ara_cli/file_classifier.py,sha256=rKgF2_tyxHUlpr_vclaZN1CKzidErRXzOng3SbSYR6Q,3903
|
|
23
22
|
ara_cli/file_lister.py,sha256=VFpUmHU1d6sQvJWSeuFqkZZ0Ci3ZYCUtAUfvgWypaYU,2314
|
|
24
23
|
ara_cli/filename_validator.py,sha256=Aw9PL8d5-Ymhp3EY6lDrUBk3cudaNqo1Uw5RzPpI1jA,118
|
|
25
24
|
ara_cli/list_filter.py,sha256=Not17hIngI37gZsLtIKxopB-BmyWoOGlBzSqBwh-Zpc,5273
|
|
@@ -32,10 +31,10 @@ ara_cli/run_file_lister.py,sha256=XbrrDTJXp1LFGx9Lv91SNsEHZPP-PyEMBF_P4btjbDA,23
|
|
|
32
31
|
ara_cli/tag_extractor.py,sha256=IlFOeWRhuojXc4qVgBlfU0SXqfL_UW_q_iBrC8pdL1U,948
|
|
33
32
|
ara_cli/template_manager.py,sha256=YXPj2jGNDb-diIHFEK_vGJ-ZucodnXSGAPofKTnOofI,6633
|
|
34
33
|
ara_cli/update_config_prompt.py,sha256=PZgNIN3dTw6p80GyX8Sp5apkAhSoykwnkEbHo3IOkUo,4571
|
|
35
|
-
ara_cli/version.py,sha256=
|
|
34
|
+
ara_cli/version.py,sha256=zdcfkgyo8ri4vHlSLr0See7qcxgboKrS8FmxdjMDD5A,146
|
|
36
35
|
ara_cli/artefact_models/artefact_load.py,sha256=dNcwZDW2Dk0bts9YnPZ0ESmWD2NbsLIvl4Z-qQeGmTQ,401
|
|
37
36
|
ara_cli/artefact_models/artefact_mapping.py,sha256=8aD0spBjkJ8toMAmFawc6UTUxB6-tEEViZXv2I-r88Q,1874
|
|
38
|
-
ara_cli/artefact_models/artefact_model.py,sha256=
|
|
37
|
+
ara_cli/artefact_models/artefact_model.py,sha256=ORnG8xKtK_hXuhfUXpiRBUV0QUUZNfR3wFSQU7oJiDo,14454
|
|
39
38
|
ara_cli/artefact_models/artefact_templates.py,sha256=Vd7SwoRVKNGKZmxBKS6f9FE1ThUOCqZLScu0ClPfIu8,8321
|
|
40
39
|
ara_cli/artefact_models/businessgoal_artefact_model.py,sha256=u9-Rr7VDYoNP6Vy2iKE64yAxDPOnrJJFozO6Ji9s8pI,4570
|
|
41
40
|
ara_cli/artefact_models/capability_artefact_model.py,sha256=SZqHx4O2mj4urn77Stnj4_Jxtlq3-LgBBU9SMkByppI,3079
|
|
@@ -131,27 +130,26 @@ ara_cli/templates/specification_breakdown_files/template.step.md,sha256=nzDRl9Xo
|
|
|
131
130
|
ara_cli/templates/specification_breakdown_files/template.technology.exploration.md,sha256=zQyiJcmbUfXdte-5uZwZUpT6ey0zwfZ00P4VwI97jQk,2274
|
|
132
131
|
ara_cli/templates/specification_breakdown_files/template.technology.md,sha256=bySiksz-8xtq0Nnj4svqe2MgUftWrVkbK9AcrDUE3KY,952
|
|
133
132
|
ara_cli/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
134
|
-
ara_cli/tests/test_ara_command_action.py,sha256=
|
|
133
|
+
ara_cli/tests/test_ara_command_action.py,sha256=N7712HbmN86ziGBKI5GoHQPp75OSyD0kHsHRxna8d9w,25446
|
|
135
134
|
ara_cli/tests/test_ara_config.py,sha256=1LWby_iSestTIIqK-1clggL8kmbGGbtlYfsxAHaMMF8,2232
|
|
136
|
-
ara_cli/tests/test_artefact.py,sha256=xMouG-yf2PQoqt_9atdRtMS1t8QsVXj549G78ZCeFu8,12718
|
|
137
135
|
ara_cli/tests/test_artefact_fuzzy_search.py,sha256=5Sh3_l9QK8-WHn6JpGPU1b6h4QEnl2JoMq1Tdp2cj1U,1261
|
|
138
136
|
ara_cli/tests/test_artefact_link_updater.py,sha256=gN5KFF1uY7OoBh8Mr5jWpqXp02YCU5OSIpSU76Rm4Gs,2137
|
|
139
|
-
ara_cli/tests/test_artefact_lister.py,sha256=
|
|
140
|
-
ara_cli/tests/test_artefact_reader.py,sha256=
|
|
137
|
+
ara_cli/tests/test_artefact_lister.py,sha256=VCEOCgDgnAOeUUgIoGAbWgz60hf9UT-tdHg18LGfB34,22656
|
|
138
|
+
ara_cli/tests/test_artefact_reader.py,sha256=660K-d8ed-j8hulsUB_7baPD2-hhbg9TffUR5yVc4Uo,927
|
|
141
139
|
ara_cli/tests/test_artefact_renamer.py,sha256=Dls9Z65h3HiG55Irki7aPOxoIxx8mfZTOqy5k2_Jbls,6155
|
|
142
140
|
ara_cli/tests/test_artefact_scan.py,sha256=m0V3HMLJtrOBXpJIRUI0D6MbHssgxDU_c935Wc3jatQ,4696
|
|
143
|
-
ara_cli/tests/test_chat.py,sha256=
|
|
141
|
+
ara_cli/tests/test_chat.py,sha256=V75baLk2ZFz5WDSFTlvdbmMb6Dm7o12xoFEulmMgMDI,46765
|
|
144
142
|
ara_cli/tests/test_classifier.py,sha256=grYGPksydNdPsaEBQxYHZTuTdcJWz7VQtikCKA6BNaQ,1920
|
|
145
143
|
ara_cli/tests/test_directory_navigator.py,sha256=7G0MVrBbtBvbrFUpL0zb_9EkEWi1dulWuHsrQxMJxDY,140
|
|
146
|
-
ara_cli/tests/test_file_classifier.py,sha256=
|
|
144
|
+
ara_cli/tests/test_file_classifier.py,sha256=6OYM-lYVYjxq4Qwl8U1btv_FYJhc5t3rKjYr2CXZ4uI,10069
|
|
147
145
|
ara_cli/tests/test_file_creator.py,sha256=ssrl7gfU13H4ogrrX1BXx4WO4bQ7OG1R2tXZC1MP8EY,2004
|
|
148
146
|
ara_cli/tests/test_file_lister.py,sha256=f6B_vIv-wAulKH2ZGgNg4SG79XqGGbfwoIvZlbEnYyM,4306
|
|
149
147
|
ara_cli/tests/test_list_filter.py,sha256=gSRKirTtFuhRS3QlFHqWl89WvCvAdVEnFsCWTYmgB2o,7928
|
|
150
148
|
ara_cli/tests/test_tag_extractor.py,sha256=A4Usip4DrCS5iOGo8wYcTvIHJfN9V_yepYDjdCUyQNk,1729
|
|
151
149
|
ara_cli/tests/test_template_manager.py,sha256=bRxka6cxHsCAOvXjfG8MrVO8qSZXhxW01tnph80UtNk,3143
|
|
152
150
|
ara_cli/tests/test_update_config_prompt.py,sha256=vSsLvc18HZdVjVM93qXWVbJt752xTLL6VGjSVCrPufk,6729
|
|
153
|
-
ara_cli-0.1.9.
|
|
154
|
-
ara_cli-0.1.9.
|
|
155
|
-
ara_cli-0.1.9.
|
|
156
|
-
ara_cli-0.1.9.
|
|
157
|
-
ara_cli-0.1.9.
|
|
151
|
+
ara_cli-0.1.9.53.dist-info/METADATA,sha256=tjJzYWfAMjsG1Z1_6Q2BiBexg02DjOhGM9y7mShGCdg,367
|
|
152
|
+
ara_cli-0.1.9.53.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
|
|
153
|
+
ara_cli-0.1.9.53.dist-info/entry_points.txt,sha256=v4h7MzysTgSIDYfEo3oj4Kz_8lzsRa3hq-KJHEcLVX8,45
|
|
154
|
+
ara_cli-0.1.9.53.dist-info/top_level.txt,sha256=zzee_PwFmKqfBi9XgIunP6xy2S4TIt593CLLxenNaAE,8
|
|
155
|
+
ara_cli-0.1.9.53.dist-info/RECORD,,
|