@@ -1379,51 +1379,6 @@ resource "github_repository" "private" {
13791379 },
13801380 })
13811381 })
1382- }
1383-
1384- func Test_expandPages (t * testing.T ) {
1385- t .Run ("expand Pages configuration with workflow" , func (t * testing.T ) {
1386- input := []any {map [string ]any {
1387- "build_type" : "workflow" ,
1388- "source" : []any {map [string ]any {}},
1389- }}
1390-
1391- pages := expandPages (input )
1392- if pages == nil {
1393- t .Fatal ("pages is nil" )
1394- }
1395- if pages .GetBuildType () != "workflow" {
1396- t .Errorf ("got %q; want %q" , pages .GetBuildType (), "workflow" )
1397- }
1398- if pages .GetSource ().GetBranch () != "main" {
1399- t .Errorf ("got %q; want %q" , pages .GetSource ().GetBranch (), "main" )
1400- }
1401- })
1402-
1403- t .Run ("expand Pages configuration with source" , func (t * testing.T ) {
1404- input := []any {map [string ]any {
1405- "build_type" : "legacy" ,
1406- "source" : []any {map [string ]any {
1407- "branch" : "main" ,
1408- "path" : "/docs" ,
1409- }},
1410- }}
1411-
1412- pages := expandPages (input )
1413- if pages == nil {
1414- t .Fatal ("pages is nil" )
1415- }
1416- if pages .GetBuildType () != "legacy" {
1417- t .Errorf ("got %q; want %q" , pages .GetBuildType (), "legacy" )
1418- }
1419- if pages .GetSource ().GetBranch () != "main" {
1420- t .Errorf ("got %q; want %q" , pages .GetSource ().GetBranch (), "main" )
1421- }
1422- if pages .GetSource ().GetPath () != "/docs" {
1423- t .Errorf ("got %q; want %q" , pages .GetSource ().GetPath (), "/docs" )
1424- }
1425- })
1426-
14271382 t .Run ("forks a repository without error" , func (t * testing.T ) {
14281383 randomID := acctest .RandString (5 )
14291384 testRepoName := fmt .Sprintf ("%sfork-%s" , testResourcePrefix , randomID )
@@ -1549,6 +1504,50 @@ func Test_expandPages(t *testing.T) {
15491504 })
15501505}
15511506
1507+ func Test_expandPages (t * testing.T ) {
1508+ t .Run ("expand Pages configuration with workflow" , func (t * testing.T ) {
1509+ input := []any {map [string ]any {
1510+ "build_type" : "workflow" ,
1511+ "source" : []any {map [string ]any {}},
1512+ }}
1513+
1514+ pages := expandPages (input )
1515+ if pages == nil {
1516+ t .Fatal ("pages is nil" )
1517+ }
1518+ if pages .GetBuildType () != "workflow" {
1519+ t .Errorf ("got %q; want %q" , pages .GetBuildType (), "workflow" )
1520+ }
1521+ if pages .GetSource ().GetBranch () != "main" {
1522+ t .Errorf ("got %q; want %q" , pages .GetSource ().GetBranch (), "main" )
1523+ }
1524+ })
1525+
1526+ t .Run ("expand Pages configuration with source" , func (t * testing.T ) {
1527+ input := []any {map [string ]any {
1528+ "build_type" : "legacy" ,
1529+ "source" : []any {map [string ]any {
1530+ "branch" : "main" ,
1531+ "path" : "/docs" ,
1532+ }},
1533+ }}
1534+
1535+ pages := expandPages (input )
1536+ if pages == nil {
1537+ t .Fatal ("pages is nil" )
1538+ }
1539+ if pages .GetBuildType () != "legacy" {
1540+ t .Errorf ("got %q; want %q" , pages .GetBuildType (), "legacy" )
1541+ }
1542+ if pages .GetSource ().GetBranch () != "main" {
1543+ t .Errorf ("got %q; want %q" , pages .GetSource ().GetBranch (), "main" )
1544+ }
1545+ if pages .GetSource ().GetPath () != "/docs" {
1546+ t .Errorf ("got %q; want %q" , pages .GetSource ().GetPath (), "/docs" )
1547+ }
1548+ })
1549+ }
1550+
15521551func TestGithubRepositoryTopicPassesValidation (t * testing.T ) {
15531552 resource := resourceGithubRepository ()
15541553 schema := resource .Schema ["topics" ].Elem .(* schema.Schema )
0 commit comments