Skip to content

Commit 705a44f

Browse files
committed
Added a second file for acceptance testing
1 parent 62d7edd commit 705a44f

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

internal/provider/data_source_gitlab_repository_tree_test.go

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,30 @@ func TestAccDataSourceGitlabRepositoryTree_basic(t *testing.T) {
1818
Steps: []resource.TestStep{
1919
{
2020
Config: fmt.Sprintf(`
21+
resource "gitlab_repository_file" "foo" {
22+
project = "%[1]d"
23+
file_path = "testfile-meow"
24+
branch = "%[2]s"
25+
content = base64encode("Meow goes the cat")
26+
commit_message = "feat: Meow"
27+
}
28+
2129
data "gitlab_repository_tree" "this" {
22-
project = %d
23-
ref = "%s"
30+
project = %[1]d
31+
ref = gitlab_repository_file.foo.branch
2432
}
2533
`, testProject.ID, testProject.DefaultBranch),
2634
Check: resource.ComposeTestCheckFunc(
27-
resource.TestCheckResourceAttr("data.gitlab_repository_tree.this", "tree.#", "1"),
35+
resource.TestCheckResourceAttr("data.gitlab_repository_tree.this", "tree.#", "2"),
2836
resource.TestCheckResourceAttr("data.gitlab_repository_tree.this", "tree.0.name", "README.md"),
2937
resource.TestCheckResourceAttr("data.gitlab_repository_tree.this", "tree.0.type", "blob"),
3038
resource.TestCheckResourceAttr("data.gitlab_repository_tree.this", "tree.0.path", "README.md"),
3139
resource.TestCheckResourceAttr("data.gitlab_repository_tree.this", "tree.0.mode", "100644"),
40+
41+
resource.TestCheckResourceAttr("data.gitlab_repository_tree.this", "tree.1.name", "testfile-meow"),
42+
resource.TestCheckResourceAttr("data.gitlab_repository_tree.this", "tree.1.type", "blob"),
43+
resource.TestCheckResourceAttr("data.gitlab_repository_tree.this", "tree.1.path", "testfile-meow"),
44+
resource.TestCheckResourceAttr("data.gitlab_repository_tree.this", "tree.1.mode", "100644"),
3245
),
3346
},
3447
},

0 commit comments

Comments
 (0)