Skip to content

Commit 71719d5

Browse files
committed
more testing/coverage
1 parent 1e531ba commit 71719d5

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

‎paths_cli/compiling/core.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ def __init__(self, builder, parameters, name=None, aliases=None,
170170
@property
171171
def schema_name(self):
172172
if not self.name.endswith(self.compiler_name):
173-
schema_name = f"{self.name}-{self.object_type}"
173+
schema_name = f"{self.name}-{self.compiler_name}"
174174
else:
175-
schema_name = self.compiler_name
175+
schema_name = self.name
176176
return schema_name
177177

178178
def to_json_schema(self, schema_context=None):

‎paths_cli/tests/commands/test_compile.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ def test_import_module_error():
1414
with pytest.raises(MissingIntegrationError, match="Unable to find"):
1515
import_module('foobarbazqux')
1616

17+
def test_import_module_install_suggestion():
18+
with pytest.raises(MissingIntegrationError, match"Please install"):
19+
import_module('foobarbazqux', install='foobarbazqux')
20+
1721
_BASIC_DICT = {'foo': ['bar', {'baz': 10}], 'qux': 'quux', 'froob': 0.5}
1822

1923
def _std_dump(module):

‎paths_cli/tests/compiling/test_core.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,14 @@ def setup(self):
146146
self.instance_builder.compiler_name = 'demo'
147147
self.input_dict = {'req_param': "qux", 'opt_override': 25}
148148

149+
def test_schema_name(self):
150+
assert self.instance_builder.schema_name == 'demo'
151+
self.instance_builder.compiler_name = 'foo'
152+
assert self.instance_builder.schema_name == 'demo-foo'
153+
self.instance_builder.name = 'demo-foo'
154+
assert self.instance_builder.schema_name == 'demo-foo'
155+
156+
149157
def test_to_json_schema(self):
150158
# to_json_schema should create a valid JSON schema entry for this
151159
# instance builder

0 commit comments

Comments
 (0)