uvlparser 2.0.1.dev50__tar.gz → 2.0.1.dev52__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uvlparser
3
- Version: 2.0.1.dev50
3
+ Version: 2.0.1.dev52
4
4
  Summary: This module provides a get_tree function to obtain an ANTLR parse-tree from a UVL-defined feature model
5
5
  Home-page: https://github.com/Universal-Variability-Language/uvl-parser
6
6
  Author: UVL Team
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setup(
7
7
  name="uvlparser",
8
- version="2.0.1.dev50",
8
+ version="2.0.1.dev52",
9
9
  description="This module provides a get_tree function to obtain an ANTLR parse-tree from a UVL-defined feature model",
10
10
  long_description=long_description,
11
11
  long_description_content_type="text/markdown",
@@ -0,0 +1,32 @@
1
+ import pytest
2
+ import glob
3
+ import os
4
+
5
+ from main import get_tree
6
+
7
+ TEST_MODELS_DIR = os.path.join(os.path.dirname(__file__), "..", "test_models")
8
+
9
+
10
+ def get_valid_files():
11
+ all_files = glob.glob(os.path.join(TEST_MODELS_DIR, "**", "*.uvl"), recursive=True)
12
+ return [f for f in all_files if os.sep + "faulty" + os.sep not in f]
13
+
14
+
15
+ def get_faulty_files():
16
+ return glob.glob(os.path.join(TEST_MODELS_DIR, "faulty", "*.uvl"))
17
+
18
+
19
+ def relative_path(file):
20
+ return os.path.relpath(file, TEST_MODELS_DIR)
21
+
22
+
23
+ @pytest.mark.parametrize("uvl_file", get_valid_files(), ids=relative_path)
24
+ def test_valid_model(uvl_file):
25
+ tree = get_tree(uvl_file)
26
+ assert tree is not None
27
+
28
+
29
+ @pytest.mark.parametrize("uvl_file", get_faulty_files(), ids=relative_path)
30
+ def test_faulty_model(uvl_file):
31
+ with pytest.raises(Exception):
32
+ get_tree(uvl_file)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uvlparser
3
- Version: 2.0.1.dev50
3
+ Version: 2.0.1.dev52
4
4
  Summary: This module provides a get_tree function to obtain an ANTLR parse-tree from a UVL-defined feature model
5
5
  Home-page: https://github.com/Universal-Variability-Language/uvl-parser
6
6
  Author: UVL Team
@@ -2,6 +2,7 @@ README.md
2
2
  __init__.py
3
3
  main.py
4
4
  setup.py
5
+ test_grammar.py
5
6
  uvl/UVLCustomLexer.py
6
7
  uvl/UVLPythonLexer.py
7
8
  uvl/UVLPythonParser.py
File without changes