-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_implementation.py
More file actions
52 lines (42 loc) · 1.84 KB
/
check_implementation.py
File metadata and controls
52 lines (42 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python3
"""
Simple validation script to check if the new methods were added correctly.
"""
import re
import os
def check_implementation():
"""Check if the new filtering methods are implemented correctly"""
# Read the main file
with open('git_repository_manager.py', 'r', encoding='utf-8') as f:
content = f.read()
# Check if new methods exist
methods_to_check = [
'_repo_has_matching_branches',
'_get_matching_branch_types',
'_add_tree_items_with_branch_filter',
'_add_repository_node_with_branch_filter'
]
print("Checking for new methods:")
for method in methods_to_check:
if f"def {method}(" in content:
print(f"✓ {method} found")
else:
print(f"✗ {method} NOT found")
# Check if update_repository_tree_with_branch_filter was modified
if "_add_tree_items_with_branch_filter" in content:
print("✓ update_repository_tree_with_branch_filter updated to use new method")
else:
print("✗ update_repository_tree_with_branch_filter not updated")
# Check for submodule filtering in update_repository_tree_with_branch_filter
if "submodule_has_matches = self._repo_has_matching_branches(submodule)" in content:
print("✓ Submodule filtering implemented")
else:
print("✗ Submodule filtering not found")
# Check for conditional local/remote category addition
if "has_local_matches, has_remote_matches = self._get_matching_branch_types(repo)" in content:
print("✓ Conditional local/remote category logic found")
else:
print("✗ Conditional local/remote category logic not found")
print("\nImplementation check complete!")
if __name__ == "__main__":
check_implementation()