Skip to content

Commit

Permalink
remove
Browse files Browse the repository at this point in the history
  • Loading branch information
nfx committed Feb 18, 2022
1 parent 1bdc4f1 commit bf81f3c
Showing 1 changed file with 0 additions and 77 deletions.
77 changes: 0 additions & 77 deletions exporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1002,83 +1002,6 @@ func TestImportingRepos(t *testing.T) {
})
}

func TestImportingGitCredentials(t *testing.T) {
provider := "gitHub"
user := "test"
resp := repos.GitCredentialResponse{
ID: 121232342,
Provider: provider,
UserName: user,
}
qa.HTTPFixturesApply(t,
[]qa.HTTPFixture{
meAdminFixture,
{
Method: "GET",
Resource: "/api/2.0/repos?",
Response: repos.ReposListResponse{
Repos: []repos.ReposInformation{},
},
},
{
Method: http.MethodGet,
Resource: "/api/2.0/git-credentials",
Response: repos.GitCredentialList{
Credentials: []repos.GitCredentialResponse{resp},
},
},
{
Method: "GET",
Resource: fmt.Sprintf("/api/2.0/git-credentials/%d", resp.ID),
Response: resp,
},
},
func(ctx context.Context, client *common.DatabricksClient) {
tmpDir := fmt.Sprintf("/tmp/tf-%s", qa.RandomName())
defer os.RemoveAll(tmpDir)

ic := newImportContext(client)
ic.Directory = tmpDir
ic.listing = "repos"
ic.services = "repos"

err := ic.Run()
assert.NoError(t, err)
})
}

func TestImportingGitCredentials_Error(t *testing.T) {
qa.HTTPFixturesApply(t,
[]qa.HTTPFixture{
meAdminFixture,
{
Method: "GET",
Resource: "/api/2.0/repos?",
Response: repos.ReposListResponse{
Repos: []repos.ReposInformation{},
},
},
{
Method: http.MethodGet,
Resource: "/api/2.0/git-credentials",
Response: repos.GitCredentialList{},
Status: 404,
},
},
func(ctx context.Context, client *common.DatabricksClient) {
tmpDir := fmt.Sprintf("/tmp/tf-%s", qa.RandomName())
defer os.RemoveAll(tmpDir)

ic := newImportContext(client)
ic.Directory = tmpDir
ic.listing = "repos"
ic.services = "repos"

err := ic.Run()
assert.Error(t, err)
})
}

func TestImportingIPAccessLists(t *testing.T) {
resp := access.IpAccessListStatus{
ListID: "123",
Expand Down

0 comments on commit bf81f3c

Please sign in to comment.