当前位置: 首页>>代码示例>>Golang>>正文


Golang godog.Suite类代码示例

本文整理汇总了Golang中github.com/DATA-DOG/godog.Suite的典型用法代码示例。如果您正苦于以下问题:Golang Suite类的具体用法?Golang Suite怎么用?Golang Suite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Suite类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: featureContext

func featureContext(s *godog.Suite) {
	api := &apiFeature{}

	s.BeforeScenario(api.resetResponse)

	s.Step(`^I send "(GET|POST|PUT|DELETE)" request to "([^"]*)"$`, api.iSendrequestTo)
	s.Step(`^the response code should be (\d+)$`, api.theResponseCodeShouldBe)
	s.Step(`^the response should match json:$`, api.theResponseShouldMatchJSON)
	s.Step(`^there are users:$`, api.thereAreUsers)
}
开发者ID:dasnook,项目名称:godog,代码行数:10,代码来源:api_test.go

示例2: FeatureContextBootstrap

// FeatureContextBootstrap setup the FeatureContext  for bootstrap steps
func FeatureContextBootstrap(bddCtx *BDDContext, s *godog.Suite) {

	s.Step(`^the orderer network has organizations:$`, bddCtx.theOrdererNetworkHasOrganizations)
	//s.Step(`^user requests role of orderer admin by creating a key and csr for orderer and acquires signed certificate from organization:$`, userRequestsRoleOfOrdererAdminByCreatingAKeyAndCsrForOrdererAndAcquiresSignedCertificateFromOrganization)
	//s.Step(`^the peer network has organizations:$`, thePeerNetworkHasOrganizations)
	//s.Step(`^a chainBootstrapAdmin is identified and given access to all public certificates and orderer node info$`, aChainBootstrapAdminIsIdentifiedAndGivenAccessToAllPublicCertificatesAndOrdererNodeInfo)
	//s.Step(`^the chainBootstrapAdmin creates the genesis block for chain \'chain(\d+)\' for network config policy \'unanimous\' and consensus \'solo\' and peer organizations:$`, theChainBootstrapAdminCreatesTheGenesisBlockForChainChainForNetworkConfigPolicyUnanimousAndConsensusSoloAndPeerOrganizations)
	//s.Step(`^the orderer admins inspect and approve the genesis block for chain \'chain(\d+)\'$`, theOrdererAdminsInspectAndApproveTheGenesisBlockForChainChain)
	//s.Step(`^the orderer admins use the genesis block for chain \'chain(\d+)\' to configure orderers$`, theOrdererAdminsUseTheGenesisBlockForChainChainToConfigureOrderers)
	//s.Step(`^user requests role of peer admin by creating a key and csr for peer and acquires signed certificate from organization:$`, userRequestsRoleOfPeerAdminByCreatingAKeyAndCsrForPeerAndAcquiresSignedCertificateFromOrganization)
	//s.Step(`^peer admins get the genesis block for chain \'chain(\d+)\' from chainBoostrapAdmin$`, peerAdminsGetTheGenesisBlockForChainChainFromChainBoostrapAdmin)
	//s.Step(`^the peer admins inspect and approve the genesis block for chain \'chain(\d+)\'$`, thePeerAdminsInspectAndApproveTheGenesisBlockForChainChain)
	//s.Step(`^the peer admins use the genesis block for chain \'chain(\d+)\' to configure peers$`, thePeerAdminsUseTheGenesisBlockForChainChainToConfigurePeers)
	//s.Step(`^user "([^"]*)" registers with peer organization "([^"]*)"$`, userRegistersWithPeerOrganization)
}
开发者ID:hyperledger,项目名称:fabric,代码行数:16,代码来源:context_bootstrap.go

示例3: featureContext

func featureContext(s *godog.Suite) {
	s.Step(`^there are (\d+) godogs$`, thereAreGodogs)
	s.Step(`^I eat (\d+)$`, iEat)
	s.Step(`^there should be (\d+) remaining$`, thereShouldBeRemaining)

	s.BeforeScenario(func(interface{}) {
		Godogs = 0 // clean the state before every scenario
	})
}
开发者ID:dasnook,项目名称:godog,代码行数:9,代码来源:godog_test.go

示例4: featureContext

func featureContext(s *godog.Suite) {
	wcf := NewWebCrawlingFeature()

	s.BeforeScenario(wcf.Reset)

	s.Step(`^an invalid url "([^"]*)"$`, wcf.anInvalidUrl)
	s.Step(`^I run the crawler with the following arguments "([^"]*)"$`, wcf.iRunTheCrawlerWithTheFollowingArguments)
	s.Step(`^I should see an error informing me "([^"]*)"$`, wcf.iShouldSeeAnErrorInformingMe)
	s.Step(`^a unfetchable url "([^"]*)"$`, wcf.aUnfetchableUrl)
	s.Step(`^the exit code should be: (\d+)$`, wcf.theExitCodeShouldBe)
	s.Step(`^a webpage "([^"]*)" containing:$`, wcf.aWebpagecontaining)
	s.Step(`^the webpages are being hosted locally$`, wcf.theWebpagesAreBeingHostedLocally)
	s.Step(`^I run the crawler with the locally hosted url$`, wcf.iRunTheCrawlerWithTheLocallyHostedUrl)
	s.Step(`^I should see the following:$`, wcf.iShouldSeeTheFollowing)
}
开发者ID:adrianduke,项目名称:crawler,代码行数:15,代码来源:feature_test.go

示例5: FeatureContext

func FeatureContext(s *godog.Suite) {
	bddCtx := &BDDContext{godogSuite: s, users: make(map[string]*UserRegistration), grpcClientPort: 7051}

	s.BeforeScenario(bddCtx.beforeScenario)
	s.AfterScenario(bddCtx.afterScenarioDecompose)

	FeatureContextBootstrap(bddCtx, s)

	s.Step(`^we compose "([^"]*)"$`, bddCtx.weCompose)
	s.Step(`^requesting "([^"]*)" from "([^"]*)"$`, bddCtx.requestingFrom)
	s.Step(`^I should get a JSON response with array "([^"]*)" contains "([^"]*)" elements$`, bddCtx.iShouldGetAJSONResponseWithArrayContainsElements)
	s.Step(`^I wait "([^"]*)" seconds$`, bddCtx.iWaitSeconds)
	s.Step(`^I register with CA supplying username "([^"]*)" and secret "([^"]*)" on peers:$`, bddCtx.iRegisterWithCASupplyingUsernameAndSecretOnPeers)
	s.Step(`^user "([^"]*)" creates a chaincode spec "([^"]*)" of type "([^"]*)" for chaincode "([^"]*)" with args$`, bddCtx.userCreatesAChaincodeSpecOfTypeForChaincodeWithArgs)

	s.Step(`^user "([^"]*)" creates a deployment spec "([^"]*)" using chaincode spec "([^"]*)" and devops on peer "([^"]*)"$`, bddCtx.userCreatesADeploymentSpecUsingChaincodeSpecAndDevopsOnPeer)
	//s.Step(`^user "([^"]*)" creates a deployment spec "([^"]*)" using chaincode spec "([^"]*)"$`, bddCtx.userCreatesADeploymentSpecUsingChaincodeSpec)

	s.Step(`^user "([^"]*)" creates a deployment proposal "([^"]*)" using chaincode deployment spec "([^"]*)"$`, bddCtx.userCreatesADeploymentProposalUsingChaincodeDeploymentSpec)
	s.Step(`^user "([^"]*)" sends proposal "([^"]*)" to endorsers with timeout of "([^"]*)" seconds:$`, bddCtx.userSendsProposalToEndorsersWithTimeoutOfSeconds)
	s.Step(`^user "([^"]*)" stores their last result as "([^"]*)"$`, bddCtx.userStoresTheirLastResultAs)
	s.Step(`^user "([^"]*)" expects proposal responses "([^"]*)" with status "([^"]*)" from endorsers:$`, bddCtx.userExpectsProposalResponsesWithStatusFromEndorsers)
	s.Step(`^user "([^"]*)" sets ESCC to "([^"]*)" for chaincode spec "([^"]*)"$`, bddCtx.userSetsESCCToForChaincodeSpec)
	s.Step(`^user "([^"]*)" sets VSCC to "([^"]*)" for chaincode spec "([^"]*)"$`, bddCtx.userSetsVSCCToForChaincodeSpec)
}
开发者ID:hyperledger,项目名称:fabric,代码行数:25,代码来源:bddtests_test.go

示例6: featureContext

func featureContext(s *godog.Suite) {
	s.BeforeScenario(func(interface{}) {
		updater = &ServiceUpdater{
			ServiceRepository: NewInMemoryServiceRepository(),
			RouterClient:      NewInMemoryVampRouterClient(),
			Configuration: Configuration{
				RootDns: "example.com",
			},
		}
	})

	s.Step(`^a k8s service named "([^"]*)" is created in the namespace "([^"]*)"$`, aKsServiceNamedIsCreatedInTheNamespace)
	s.Step(`^a k8s service named "([^"]*)" is created in the namespace "([^"]*)" with the IP "([^"]*)"$`, aKsServiceNamedIsCreatedInTheNamespaceWithTheIP)
	s.Step(`^the vamp service "([^"]*)" should be created$`, theVampServiceShouldBeCreated)
	s.Step(`^the vamp route "([^"]*)" should be created$`, theVampRouteShouldBeCreated)
	s.Step(`^a vamp route named "([^"]*)" already exists$`, aVampRouteNamedAlreadyExists)
	s.Step(`^the vamp filter named "([^"]*)" should be created$`, theVampFilterNamedShouldBeCreated)
	s.Step(`^the vamp service "([^"]*)" should only contain the backend "([^"]*)"$`, theVampServiceShouldOnlyContainTheBackend)
	s.Step(`^a k8s service named "([^"]*)" is updated in the namespace "([^"]*)" with the IP "([^"]*)"$`, aKsServiceNamedIsUpdatedInTheNamespaceWithTheIP)
	s.Step(`^the vamp route should not be updated$`, theVampRouteShouldNotBeUpdated)
	s.Step(`^the vamp route should be updated$`, theVampRouteShouldBeUpdated)
	s.Step(`^the k8s service "([^"]*)" is in the namespace "([^"]*)"$`, theKsServiceisInTheNamespace)
	s.Step(`^the k8s service "([^"]*)" IP is "([^"]*)"$`, theKsServiceIPIs)
	s.Step(`^the k8s service named "([^"]*)" is created$`, theKsServiceNamedisCreated)
	s.Step(`^the k8s service named "([^"]*)" is updated$`, theKsServiceNamedisUpdated)
	s.Step(`^the k8s service "([^"]*)" has the following annotations:$`, theKsServicehasTheFollowingAnnotations)
}
开发者ID:sroze,项目名称:kubernetes-vamp-router,代码行数:27,代码来源:serviceupdater_test.go


注:本文中的github.com/DATA-DOG/godog.Suite类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。