(cfg TestConfig, client *helper.DevlakeClient)
| 147 | } |
| 148 | |
| 149 | func createConnection(cfg TestConfig, client *helper.DevlakeClient) *helper.Connection { |
| 150 | conn := pluginmodels.TestmoConn{ |
| 151 | RestConnection: api.RestConnection{ |
| 152 | Endpoint: "https://yourorganization.testmo.net/api/v1", // Update this endpoint in testmo_local_test.go as needed |
| 153 | Proxy: "", |
| 154 | RateLimitPerHour: 0, |
| 155 | }, |
| 156 | AccessToken: api.AccessToken{ |
| 157 | Token: cfg.Token, |
| 158 | }, |
| 159 | } |
| 160 | client.TestConnection(pluginName, conn) |
| 161 | connections := client.ListConnections(pluginName) |
| 162 | for _, connection := range connections { |
| 163 | if connection.Name == "testmo-conn" { |
| 164 | return connection |
| 165 | } |
| 166 | } |
| 167 | return client.CreateConnection(pluginName, pluginmodels.TestmoConnection{ |
| 168 | BaseConnection: api.BaseConnection{ |
| 169 | Name: "testmo-conn", |
| 170 | }, |
| 171 | TestmoConn: conn, |
| 172 | }) |
| 173 | } |
no test coverage detected