refactor: enhance code clarity and maintainability across multiple files

- Updated comments to improve clarity and adhere to best practices in ascii.go, main.go, and diagnostics.
- Removed unnecessary linter directives for improved readability in imaging.go and ptz.go.
- Reformatted function signatures and added helper calls in tests for consistency and clarity.
- Enhanced error handling and logging consistency in various server files, ensuring better maintainability.
This commit is contained in:
0x524a
2025-12-02 22:21:20 -05:00
parent c1daba5be6
commit 02f79ea7a7
12 changed files with 70 additions and 56 deletions
+3 -2
View File
@@ -12,6 +12,7 @@ import (
"testing"
)
const testXMLHeader = `<?xml version="1.0"?>`
func TestNewHandler(t *testing.T) {
handler := NewHandler("admin", "password")
@@ -68,7 +69,7 @@ func TestServeHTTPValidSOAPRequest(t *testing.T) {
})
// Create SOAP request
soapBody := `<?xml version="1.0"?>
soapBody := testXMLHeader + `
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<TestAction/>
@@ -323,7 +324,7 @@ func TestAuthenticateFailsWithWrongPassword(t *testing.T) {
func TestHandlerWithoutAuthentication(t *testing.T) {
handler := NewHandler("", "") // No authentication
soapBody := `<?xml version="1.0"?>
soapBody := testXMLHeader + `
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<TestAction/>