@@ -418,6 +418,81 @@ def test_below_check_critical(self, mock_nitro_server):
418418 assert "disk1perusage" in result .message
419419
420420
421+ class TestNSConfigCommandWithMockAPI :
422+ """Test nsconfig command against mock API"""
423+
424+ def test_nsconfig_no_changes (self , mock_nitro_server ):
425+ """Test nsconfig when no unsaved changes"""
426+ with NITROClient (
427+ hostname = mock_nitro_server .host ,
428+ port = mock_nitro_server .port ,
429+ username = "nsroot" ,
430+ password = "nsroot" ,
431+ ssl = False ,
432+ ) as client :
433+ args = Namespace (command = "nsconfig" )
434+
435+ from check_netscaler .commands .nsconfig import NSConfigCommand
436+
437+ command = NSConfigCommand (client , args )
438+ result = command .execute ()
439+
440+ assert result .status == STATE_OK
441+ assert "No unsaved configuration changes" in result .message
442+
443+
444+ class TestHWInfoCommandWithMockAPI :
445+ """Test hwinfo command against mock API"""
446+
447+ def test_hwinfo_display (self , mock_nitro_server ):
448+ """Test hwinfo displays hardware information"""
449+ with NITROClient (
450+ hostname = mock_nitro_server .host ,
451+ port = mock_nitro_server .port ,
452+ username = "nsroot" ,
453+ password = "nsroot" ,
454+ ssl = False ,
455+ ) as client :
456+ args = Namespace (command = "hwinfo" )
457+
458+ from check_netscaler .commands .hwinfo import HWInfoCommand
459+
460+ command = HWInfoCommand (client , args )
461+ result = command .execute ()
462+
463+ assert result .status == STATE_OK
464+ assert "Platform" in result .message or "CPU" in result .message
465+
466+
467+ class TestDebugCommandWithMockAPI :
468+ """Test debug command against mock API"""
469+
470+ def test_debug_raw_response (self , mock_nitro_server ):
471+ """Test debug shows raw API response"""
472+ with NITROClient (
473+ hostname = mock_nitro_server .host ,
474+ port = mock_nitro_server .port ,
475+ username = "nsroot" ,
476+ password = "nsroot" ,
477+ ssl = False ,
478+ ) as client :
479+ args = Namespace (
480+ command = "debug" ,
481+ objecttype = "lbvserver" ,
482+ objectname = "lb_web" ,
483+ endpoint = "config" ,
484+ )
485+
486+ from check_netscaler .commands .debug import DebugCommand
487+
488+ command = DebugCommand (client , args )
489+ result = command .execute ()
490+
491+ assert result .status == STATE_OK
492+ # Debug command returns JSON response
493+ assert "lbvserver" in result .message or "lb_web" in result .message
494+
495+
421496class TestLicenseCommandWithMockAPI :
422497 """Test license command against mock API"""
423498
0 commit comments