當前位置: 首頁>>代碼示例>>Golang>>正文


Golang i18n.Init函數代碼示例

本文整理匯總了Golang中code/cloudfoundry/org/cli/cf/i18n.Init函數的典型用法代碼示例。如果您正苦於以下問題:Golang Init函數的具體用法?Golang Init怎麽用?Golang Init使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Init函數的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: TestQuota

func TestQuota(t *testing.T) {
	config := configuration.NewRepositoryWithDefaults()
	i18n.T = i18n.Init(config)

	RegisterFailHandler(Fail)
	RunSpecs(t, "Quota Suite")
}
開發者ID:fujitsu-cf,項目名稱:cli,代碼行數:7,代碼來源:quota_suite_test.go

示例2: TestSecurityGroupSpaces

func TestSecurityGroupSpaces(t *testing.T) {
	config := configuration.NewRepositoryWithDefaults()
	i18n.T = i18n.Init(config)

	RegisterFailHandler(Fail)
	RunSpecs(t, "SecurityGroupSpaces Suite")
}
開發者ID:fujitsu-cf,項目名稱:cli,代碼行數:7,代碼來源:suite_test.go

示例3: TestCopyApplicationSource

func TestCopyApplicationSource(t *testing.T) {
	config := configuration.NewRepositoryWithDefaults()
	i18n.T = i18n.Init(config)

	RegisterFailHandler(Fail)
	RunSpecs(t, "CopyApplicationSource Suite")
}
開發者ID:fujitsu-cf,項目名稱:cli,代碼行數:7,代碼來源:copy_application_source_suite_test.go

示例4: TestEnvironmentvariablegroup

func TestEnvironmentvariablegroup(t *testing.T) {
	config := configuration.NewRepositoryWithDefaults()
	i18n.T = i18n.Init(config)

	RegisterFailHandler(Fail)
	RunSpecs(t, "Environmentvariablegroup Suite")
}
開發者ID:fujitsu-cf,項目名稱:cli,代碼行數:7,代碼來源:environmentvariablegroup_suite_test.go

示例5: TestFeatureflag

func TestFeatureflag(t *testing.T) {
	config := configuration.NewRepositoryWithDefaults()
	i18n.T = i18n.Init(config)

	RegisterFailHandler(Fail)
	RunSpecs(t, "FeatureFlag Suite")
}
開發者ID:fujitsu-cf,項目名稱:cli,代碼行數:7,代碼來源:featureflag_suite_test.go

示例6: TestServiceauthtoken

func TestServiceauthtoken(t *testing.T) {
	config := configuration.NewRepositoryWithDefaults()
	i18n.T = i18n.Init(config)

	RegisterFailHandler(Fail)
	RunSpecs(t, "Serviceauthtoken Suite")
}
開發者ID:fujitsu-cf,項目名稱:cli,代碼行數:7,代碼來源:serviceauthtoken_suite_test.go

示例7: TestPluginRepo

func TestPluginRepo(t *testing.T) {
	config := configuration.NewRepositoryWithDefaults()
	i18n.T = i18n.Init(config)

	_ = pluginrepo.RepoPlugins{}

	RegisterFailHandler(Fail)
	RunSpecs(t, "PluginRepo Suite")
}
開發者ID:fujitsu-cf,項目名稱:cli,代碼行數:9,代碼來源:plugin_repo_suite_test.go

示例8: TestCommands

func TestCommands(t *testing.T) {
	config := configuration.NewRepositoryWithDefaults()
	i18n.T = i18n.Init(config)

	_ = commands.API{}

	RegisterFailHandler(Fail)
	RunSpecs(t, "Commands Suite")
}
開發者ID:fujitsu-cf,項目名稱:cli,代碼行數:9,代碼來源:commands_suite_test.go

示例9: TestPlugin

func TestPlugin(t *testing.T) {
	config := configuration.NewRepositoryWithDefaults()
	i18n.T = i18n.Init(config)

	_ = plugin.Plugins{}

	RegisterFailHandler(Fail)

	pluginbuilder.BuildTestBinary(filepath.Join("..", "..", "..", "fixtures", "plugins"), "test_with_help")
	pluginbuilder.BuildTestBinary(filepath.Join("..", "..", "..", "fixtures", "plugins"), "test_with_orgs")
	pluginbuilder.BuildTestBinary(filepath.Join("..", "..", "..", "fixtures", "plugins"), "test_with_orgs_short_name")
	pluginbuilder.BuildTestBinary(filepath.Join("..", "..", "..", "fixtures", "plugins"), "test_with_push")
	pluginbuilder.BuildTestBinary(filepath.Join("..", "..", "..", "fixtures", "plugins"), "test_with_push_short_name")
	pluginbuilder.BuildTestBinary(filepath.Join("..", "..", "..", "fixtures", "plugins"), "test_1")
	pluginbuilder.BuildTestBinary(filepath.Join("..", "..", "..", "fixtures", "plugins"), "test_2")
	pluginbuilder.BuildTestBinary(filepath.Join("..", "..", "..", "fixtures", "plugins"), "empty_plugin")
	pluginbuilder.BuildTestBinary(filepath.Join("..", "..", "..", "fixtures", "plugins"), "alias_conflicts")

	RunSpecs(t, "Plugin Suite")
}
開發者ID:fujitsu-cf,項目名稱:cli,代碼行數:20,代碼來源:plugin_suite_test.go

示例10:

			It("extrapolates the loggregator URL if there is a trailing slash", func() {
				endpoint := r.LoggregatorEndpoint(ccInfo, "https://127.0.0.1:443/")
				Expect(endpoint).To(Equal("wss://loggregator.0.0.1:443"))
			})

			It("extrapolates the loggregator URL based on the API URL (non-SSL API)", func() {
				endpoint := r.LoggregatorEndpoint(ccInfo, "http://127.0.0.1:80")
				Expect(endpoint).To(Equal("ws://loggregator.0.0.1:80"))
			})
		})
	})
	Describe("Refresh", func() {
		BeforeEach(func() {
			config := configuration.NewRepositoryWithDefaults()
			i18n.T = i18n.Init(config)
		})

		Context("when the cloud controller returns an insecure api endpoint", func() {
			var (
				r            APIConfigRefresher
				ccInfo       *CCInfo
				endpointRepo *coreconfigfakes.FakeEndpointRepository
			)

			BeforeEach(func() {
				ccInfo = &CCInfo{
					LoggregatorEndpoint: "some-endpoint",
				}
				endpointRepo = new(coreconfigfakes.FakeEndpointRepository)
開發者ID:fujitsu-cf,項目名稱:cli,代碼行數:29,代碼來源:api_config_refresher_test.go

示例11: Locale

	. "github.com/bluemixgaragelondon/cf-blue-green-deploy"
	"github.com/cloudfoundry-incubator/candiedyaml"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

type localeGetter struct{}

func (l localeGetter) Locale() string {
	return "en-us"
}

var _ = Describe("Manifest reader", func() {

	// testing code that calls into cf cli requires T to point to a translate func
	i18n.T = i18n.Init(localeGetter{})

	Context("When the manifest file is present", func() {
		Context("when the manifest contain a host but no app name", func() {
			repo := FakeRepo{yaml: `---
        host: foo`,
			}
			manifestAppFinder := ManifestAppFinder{AppName: "foo", Repo: &repo}

			It("Returns params that contain the host", func() {
				Expect(manifestAppFinder.AppParams().Hosts).To(ContainElement("foo"))
			})
		})

		Context("when the manifest contains a different app name", func() {
			repo := FakeRepo{yaml: `---
開發者ID:bluemixgaragelondon,項目名稱:cf-blue-green-deploy,代碼行數:31,代碼來源:manifest_test.go

示例12: TestActors

func TestActors(t *testing.T) {
	i18n.T = i18n.Init(configuration.NewRepositoryWithDefaults())
	RegisterFailHandler(Fail)
	RunSpecs(t, "Actors Suite")
}
開發者ID:fujitsu-cf,項目名稱:cli,代碼行數:5,代碼來源:actors_suite_test.go


注:本文中的code/cloudfoundry/org/cli/cf/i18n.Init函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。