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:
@@ -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/>
|
||||
|
||||
Reference in New Issue
Block a user