refactor: improve media service client methods and clean up test files
- Introduced helper methods `getMediaEndpoint` and `getMediaSoapClient` in the media client for better code reuse and clarity. - Updated various media service methods to utilize the new helper methods, enhancing maintainability. - Cleaned up test files by standardizing formatting and removing unnecessary blank lines for improved readability.
This commit is contained in:
@@ -20,9 +20,9 @@ func TestHandleGetDeviceInformation(t *testing.T) {
|
||||
}
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
got string
|
||||
want string
|
||||
name string
|
||||
got string
|
||||
want string
|
||||
}{
|
||||
{"Manufacturer", deviceResp.Manufacturer, config.DeviceInfo.Manufacturer},
|
||||
{"Model", deviceResp.Model, config.DeviceInfo.Model},
|
||||
@@ -206,8 +206,8 @@ func TestCapabilitiesStructure(t *testing.T) {
|
||||
XAddr: "http://localhost:8080/onvif/media_service",
|
||||
StreamingCapabilities: &StreamingCapabilities{
|
||||
RTPMulticast: true,
|
||||
RTP_TCP: true,
|
||||
RTP_RTSP_TCP: true,
|
||||
RTP_TCP: true,
|
||||
RTP_RTSP_TCP: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -236,8 +236,8 @@ func TestMediaCapabilitiesStructure(t *testing.T) {
|
||||
XAddr: "http://localhost:8080/onvif/media_service",
|
||||
StreamingCapabilities: &StreamingCapabilities{
|
||||
RTPMulticast: true,
|
||||
RTP_TCP: true,
|
||||
RTP_RTSP_TCP: true,
|
||||
RTP_TCP: true,
|
||||
RTP_RTSP_TCP: true,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -362,8 +362,8 @@ func TestGetCapabilitiesResponse(t *testing.T) {
|
||||
XAddr: "http://localhost:8080/media",
|
||||
StreamingCapabilities: &StreamingCapabilities{
|
||||
RTPMulticast: true,
|
||||
RTP_TCP: true,
|
||||
RTP_RTSP_TCP: true,
|
||||
RTP_TCP: true,
|
||||
RTP_RTSP_TCP: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user