當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。