Override session methods to use our mocks
(mockSess *MockSession)
| 115 | |
| 116 | // Override session methods to use our mocks |
| 117 | func setupMockSession(mockSess *MockSession) { |
| 118 | // Replace the Session's FindMAC method behavior by manipulating the LAN |
| 119 | // Since we can't override methods directly, we'll ensure the LAN has the data |
| 120 | for ip, mac := range mockSess.findMACResults { |
| 121 | mockSess.Lan.AddIfNew(ip, mac.String()) |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | func (m *MockSession) FindMAC(ip net.IP, probe bool) (net.HardwareAddr, error) { |
| 126 | // First check our mock results |