Abin Simon be59928f98
Fix cases where we had a trailing comma (#4208)
Not sure if we wanna merge it as it might generate way too many conflicts, but this should help us add a linter in CI. If we are good, I'll add something that can do lints for this in a follow up PR.

Super hacky, but this fix was created using `while true ; do tree-grepper -q go '(argument_list "," @nope .)' | tail -n1| awk -F: "{print \$1,\"+\"\$2\" -c ':norm \$xJZZ'\"}" | xargs vim ; done`.

---

#### Does this PR need a docs update or release note?

- [ ]  Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [ ]  No

#### Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* https://github.com/alcionai/corso/issues/3654

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
2023-09-08 17:10:29 +00:00

49 lines
1.2 KiB
Go

package tconfig
import (
"testing"
"github.com/alcionai/clues"
"github.com/stretchr/testify/require"
"github.com/alcionai/corso/src/pkg/account"
"github.com/alcionai/corso/src/pkg/credentials"
)
var M365AcctCredEnvs = []string{
credentials.AzureClientID,
credentials.AzureClientSecret,
}
// NewM365Account returns an account.Account object initialized with environment
// variables used for integration tests that use the m365 Controller.
func NewM365Account(t *testing.T) account.Account {
cfg, err := ReadTestConfig()
require.NoError(t, err, "configuring m365 account from test configuration", clues.ToCore(err))
acc, err := account.NewAccount(
account.ProviderM365,
account.M365Config{
M365: credentials.GetM365(),
AzureTenantID: cfg[TestCfgAzureTenantID],
})
require.NoError(t, err, "initializing account", clues.ToCore(err))
return acc
}
func NewFakeM365Account(t *testing.T) account.Account {
acc, err := account.NewAccount(
account.ProviderM365,
account.M365Config{
M365: credentials.M365{
AzureClientID: "12345",
AzureClientSecret: "abcde",
},
AzureTenantID: "09876",
})
require.NoError(t, err, "initializing mock account", clues.ToCore(err))
return acc
}