Skip to content

Commit 9724c00

Browse files
author
PyCompiler ARK++
committed
revue des test et correctif du code pour que les test soit touts validés
1 parent 0182892 commit 9724c00

20 files changed

Lines changed: 470 additions & 225 deletions

Core/ark_config_loader.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,6 @@ def should_exclude_file(file_path: str, workspace_dir: str, exclusion_patterns:
217217
Returns:
218218
True si le fichier doit être exclu, False sinon
219219
"""
220-
import fnmatch
221-
222220
try:
223221
file_path_obj = Path(file_path)
224222
workspace_path_obj = Path(workspace_dir)
@@ -228,11 +226,14 @@ def should_exclude_file(file_path: str, workspace_dir: str, exclusion_patterns:
228226
except ValueError:
229227
return True
230228

229+
# Use Path.match() which properly handles ** glob patterns
231230
relative_str = relative_path.as_posix()
232231
for pattern in exclusion_patterns:
233-
if fnmatch.fnmatch(relative_str, pattern):
232+
# Try matching against the relative path
233+
if relative_path.match(pattern):
234234
return True
235-
if fnmatch.fnmatch(file_path_obj.name, pattern):
235+
# Also try matching just the filename for simple patterns like "*.pyc"
236+
if file_path_obj.match(pattern):
236237
return True
237238

238239
return False

Tests/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright 2025 Ague Samuel Amen
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+

Tests/conftest.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright 2025 Ague Samuel Amen
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
116
import os
217
import shutil
318
from pathlib import Path

Tests/test_ark_config_loader_deep_and_getters.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright 2025 Ague Samuel Amen
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
116
import unittest
217
from Core.ark_config_loader import (
318
_deep_merge_dict,

Tests/test_ark_config_loader_exclusion_and_default_create.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright 2025 Ague Samuel Amen
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
116
import os
217
import tempfile
318
import unittest

Tests/test_base_pluginmeta.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright 2025 Ague Samuel Amen
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
116
import unittest
217
from bcasl.Base import PluginMeta
318

Tests/test_base_precompilecontext_iter_files.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright 2025 Ague Samuel Amen
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
116
import unittest
217
import tempfile
318
from pathlib import Path

Tests/test_bcasl_config.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
#!/usr/bin/env python3
1+
#!/usr/bin/env python3
2+
# SPDX-License-Identifier: Apache-2.0
3+
# Copyright 2025 Ague Samuel Amen
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
217
"""
318
Test script to verify BCASL YAML configuration support and ARK integration.
419
"""
@@ -30,7 +45,6 @@ def test_ark_config_loader():
3045
assert "plugins" in config, "plugins section missing from loaded config"
3146

3247
print("✓ ARK configuration loaded successfully")
33-
return True
3448

3549

3650
def test_bcasl_yaml_support():
@@ -53,7 +67,6 @@ def test_bcasl_yaml_support():
5367
else:
5468
print("⚠ bcasl.yaml not found (this is optional)")
5569

56-
return True
5770

5871

5972
def test_bcasl_loader_integration():
@@ -79,8 +92,6 @@ def test_bcasl_loader_integration():
7992
options = config.get("options", {})
8093
assert "enabled" in options, "options.enabled missing"
8194
print(f"✓ BCASL enabled: {options.get('enabled', True)}")
82-
83-
return True
8495

8596

8697
def test_yaml_priority():
@@ -114,8 +125,6 @@ def test_yaml_priority():
114125

115126
# The config should have merged with defaults, but YAML should be loaded first
116127
print("✓ YAML file priority verified")
117-
118-
return True
119128

120129

121130
def main():

Tests/test_bcasl_loader.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright 2025 Ague Samuel Amen
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
116
import unittest
217
from pathlib import Path
318

Tests/test_bcasl_workspace_config_extended.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright 2025 Ague Samuel Amen
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
116
import unittest
217
import json
318

0 commit comments

Comments
 (0)