@@ -255,6 +255,38 @@ def test_bootstrap_json_hides_scan_progress(self, mock_zpl_cls):
255255 assert "printers_found" in result .output
256256
257257
258+ class TestCLIBootstrapTrailingDot :
259+ """Tests for trailing-dot ip_stub rejection in bootstrap command."""
260+
261+ def test_bootstrap_rejects_trailing_dot (self ):
262+ """bootstrap --ip-stub '192.168.1.' exits with error."""
263+ result = runner .invoke (app , ["bootstrap" , "--ip-stub" , "192.168.1." ])
264+ assert result .exit_code == 1
265+ assert "trailing dot" in result .output
266+
267+ def test_bootstrap_rejects_trailing_dot_short_flag (self ):
268+ """bootstrap -i '10.0.0.' exits with error."""
269+ result = runner .invoke (app , ["bootstrap" , "-i" , "10.0.0." ])
270+ assert result .exit_code == 1
271+ assert "trailing dot" in result .output
272+
273+
274+ class TestCLIPrinterScanTrailingDot :
275+ """Tests for trailing-dot ip_stub rejection in printer scan command."""
276+
277+ def test_printer_scan_rejects_trailing_dot (self ):
278+ """printer scan --ip-stub '192.168.1.' exits with error."""
279+ result = runner .invoke (app , ["printer" , "scan" , "--ip-stub" , "192.168.1." ])
280+ assert result .exit_code == 1
281+ assert "trailing dot" in result .output
282+
283+ def test_printer_scan_rejects_trailing_dot_short_flag (self ):
284+ """printer scan -i '10.0.0.' exits with error."""
285+ result = runner .invoke (app , ["printer" , "scan" , "-i" , "10.0.0." ])
286+ assert result .exit_code == 1
287+ assert "trailing dot" in result .output
288+
289+
258290
259291# ---------------------------------------------------------------------------
260292# zday man — interactive documentation browser
0 commit comments