Skip to content

Commit

Permalink
fix: Corrected assemble to push files into the correct location.
Browse files Browse the repository at this point in the history
  • Loading branch information
butler54 authored Feb 2, 2021
2 parents a2949e1 + 44d884e commit f3bc0e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/trestle/core/commands/assemble_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_assemble_catalog(testdata_dir: pathlib.Path, tmp_trestle_dir: pathlib.P
assert rc == 0

# Read assembled model
actual_model = Catalog.oscal_read(pathlib.Path('dist/catalog.json'))
actual_model = Catalog.oscal_read(pathlib.Path('dist/catalogs/mycatalog.json'))
_, _, expected_model = load_distributed(mycatalog_dir / 'catalog.json')

assert actual_model == expected_model
Expand Down
5 changes: 4 additions & 1 deletion trestle/core/commands/assemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ def assemble_model(cls, model_alias: str, object_type: Type[TLO], args: argparse

# distributed load
_, _, assembled_model = load_distributed(root_model_filepath)
assembled_model_filepath = trestle_root / const.TRESTLE_DIST_DIR / f'{model_alias}.{args.extension}'
plural_alias = model_alias if model_alias[-1] == 's' else model_alias + 's'
assembled_model_dir = trestle_root / const.TRESTLE_DIST_DIR / plural_alias

assembled_model_filepath = assembled_model_dir / f'{args.name}.{args.extension}'

plan = Plan()
plan.add_action(CreatePathAction(assembled_model_filepath, True))
Expand Down

0 comments on commit f3bc0e5

Please sign in to comment.