licos-dev-cli 0.3.0__tar.gz → 0.3.2__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,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: licos-dev-cli
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: LICOS Dev CLI - generate files and call model capabilities
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: click>=8.1
7
- Requires-Dist: licos-dev-sdk>=0.3.0
7
+ Requires-Dist: licos-dev-sdk>=0.3.2
@@ -4,11 +4,11 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "licos-dev-cli"
7
- version = "0.3.0"
7
+ version = "0.3.2"
8
8
  description = "LICOS Dev CLI - generate files and call model capabilities"
9
9
  requires-python = ">=3.10"
10
10
  dependencies = [
11
- "licos-dev-sdk>=0.3.0",
11
+ "licos-dev-sdk>=0.3.2",
12
12
  "click>=8.1",
13
13
  ]
14
14
 
@@ -211,6 +211,7 @@ def docx(input_path, content, filename, output_dir, content_type, font, font_siz
211
211
  header=header,
212
212
  footer=footer,
213
213
  include_toc=toc,
214
+ asset_base_path=str(Path(input_path).resolve().parent) if input_path else None,
214
215
  )
215
216
  _echo_path(path)
216
217
 
@@ -1,6 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import json
4
+ from pathlib import Path
4
5
  from unittest import mock
5
6
 
6
7
  from click.testing import CliRunner
@@ -37,3 +38,28 @@ def test_credit_check_forwards_structured_options() -> None:
37
38
  resource_code="IMAGE_GENERATE",
38
39
  request_id="request-1",
39
40
  )
41
+
42
+
43
+ def test_docx_uses_input_directory_as_asset_base_path(tmp_path: Path) -> None:
44
+ source_dir = tmp_path / "source"
45
+ source_dir.mkdir()
46
+ input_path = source_dir / "report.html"
47
+ input_path.write_text('<img src="chart.png">', encoding="utf-8")
48
+
49
+ with mock.patch(
50
+ "licos_dev_sdk.create_docx",
51
+ return_value=str(tmp_path / "report.docx"),
52
+ ) as create:
53
+ result = CliRunner().invoke(
54
+ cli,
55
+ [
56
+ "docx",
57
+ "--input",
58
+ str(input_path),
59
+ "--filename",
60
+ "report.docx",
61
+ ],
62
+ )
63
+
64
+ assert result.exit_code == 0
65
+ assert create.call_args.kwargs["asset_base_path"] == str(source_dir.resolve())
File without changes