func (suite *testSuite) TestGetGoRuntimeNameFromBuildPath() {
	suite.builder.options.FunctionConfig.Spec.Runtime = ""
	suite.builder.options.FunctionConfig.Spec.Build.Path = "/foo.go"
	runtimeName, err := suite.builder.getRuntimeName()
	suite.Require().NoError(err)
	suite.Require().Equal("golang", runtimeName)
}
Make sure that "Builder.getRuntimeName" properly reads the runtime name from the build path if not set by the user
package build
import (
	"encoding/base64"
	"fmt"
	"io/ioutil"
	"net/http"
	"path/filepath"
	"testing"
	"github.com/nuclio/nuclio/pkg/common"
	gitcommon "github.com/nuclio/nuclio/pkg/common/git"
	"github.com/nuclio/nuclio/pkg/functionconfig"
	"github.com/nuclio/nuclio/pkg/platform"
	mockplatform "github.com/nuclio/nuclio/pkg/platform/mock"
	"github.com/jarcoal/httpmock"
	"github.com/nuclio/errors"
	"github.com/nuclio/logger"
	"github.com/nuclio/zap"
	"github.com/rs/xid"
	"github.com/stretchr/testify/mock"
	"github.com/stretchr/testify/suite"
)
const (
	FunctionsArchiveFilePath = "test/test_funcs.zip"
)
type testSuite struct {
	suite.Suite
	logger       logger.Logger
	builder      *Builder
	testID       string
	mockS3Client *common.MockS3Client
	mockPlatform *mockplatform.Platform
}
func (suite *testSuite) SetupSuite() {
	var err error
	suite.logger, err = nucliozap.NewNuclioZapTest("test")
	suite.Require().NoError(err)
	suite.mockS3Client = &common.MockS3Client{
		FilePath: FunctionsArchiveFilePath,
	}
	suite.mockPlatform = &mockplatform.Platform{}
}
func (suite *testSuite) SetupTest() {
	var err error
	suite.testID = xid.New().String()
	suite.builder, err = NewBuilder(suite.logger, suite.mockPlatform, suite.mockS3Client)
	if err != nil {
		suite.Fail("Instantiating Builder failed:", err)
	}
	createFunctionOptions := &platform.CreateFunctionOptions{
		Logger:         suite.logger,
		FunctionConfig: *functionconfig.NewConfig(),
	}
	createFunctionBuildOptions := &platform.CreateFunctionBuildOptions{
		Logger:         createFunctionOptions.Logger,
		FunctionConfig: createFunctionOptions.FunctionConfig,
	}
	suite.builder.options = createFunctionBuildOptions
}
func (suite *testSuite) TestGetRuntimeNameFromConfig() {
	suite.builder.options.FunctionConfig.Spec.Runtime = "foo"
	runtimeName, err := suite.builder.getRuntimeName()
	if err != nil {
		suite.Fail(err.Error())
	}
	suite.Require().Equal("foo", runtimeName)
}
func (suite *testSuite) TestGetPythonRuntimeNameFromBuildPath() {
	suite.builder.options.FunctionConfig.Spec.Runtime = ""
	suite.builder.options.FunctionConfig.Spec.Build.Path = "/foo.py"
	runtimeName, err := suite.builder.getRuntimeName()
	suite.Require().NoError(err)
	suite.Require().Equal("python", runtimeName)
}