File tree Expand file tree Collapse file tree 1 file changed +70
-0
lines changed
Expand file tree Collapse file tree 1 file changed +70
-0
lines changed Original file line number Diff line number Diff line change 1+ """Tests for the "_get_application_import_names" method of _cli.py."""
2+
3+ import pytest
4+
5+ from ni_python_styleguide ._cli import _get_application_import_names
6+
7+
8+ @pytest .mark .parametrize (
9+ "pyproject_obj, expected_names" ,
10+ [
11+ (
12+ {
13+ "tool" : {
14+ "ni-python-styleguide" : {
15+ "application-import-names" : "ain1,ain2"
16+ },
17+ "poetry" : {
18+ "name" : "tool.poetry.name"
19+ }
20+ },
21+ "project" : {
22+ "import-names" : ["import-names1" , "import-names2" ],
23+ "name" : "project.name"
24+ }
25+ },
26+ "ain1,ain2,tests"
27+ ),
28+ (
29+ {
30+ "tool" : {
31+ "poetry" : {
32+ "name" : "tool.poetry.name"
33+ }
34+ },
35+ "project" : {
36+ "import-names" : ["import-names1" , "import-names2" ],
37+ "name" : "project.name"
38+ }
39+ },
40+ "import-names1,import-names2,tests"
41+ ),
42+ (
43+ {
44+ "tool" : {
45+ "poetry" : {
46+ "name" : "tool.poetry.name"
47+ }
48+ },
49+ "project" : {
50+ "name" : "project.name"
51+ }
52+ },
53+ "project.name,tests"
54+ ),
55+ (
56+ {
57+ "tool" : {
58+ "poetry" : {
59+ "name" : "tool.poetry.name"
60+ }
61+ }
62+ },
63+ "tool.poetry.name,tests"
64+ )
65+ ],
66+ )
67+ def test_get_application_import_names_returns_valid_data (pyproject_obj , expected_names ):
68+ """Tests that _get_application_import_names returns valid data."""
69+ result = _get_application_import_names (pyproject_obj )
70+ assert result == expected_names
You can’t perform that action at this time.
0 commit comments