Пример #1
0
			rpcHandlers *fake_rpc_handlers.FakeHandlers
			ts          *test_rpc_server.TestServer
			err         error
		)

		BeforeEach(func() {
			rpcHandlers = &fake_rpc_handlers.FakeHandlers{}
			ts, err = test_rpc_server.NewTestRpcServer(rpcHandlers)
			Expect(err).NotTo(HaveOccurred())

			err = ts.Start()
			Expect(err).NotTo(HaveOccurred())

			//set rpc.CallCoreCommand to a successful call
			rpcHandlers.CallCoreCommandStub = func(_ []string, retVal *bool) error {
				*retVal = true
				return nil
			}

			//set rpc.GetOutputAndReset to return empty string; this is used by CliCommand()/CliWithoutTerminalOutput()
			rpcHandlers.GetOutputAndResetStub = func(_ bool, retVal *[]string) error {
				*retVal = []string{"{}"}
				return nil
			}

		})

		AfterEach(func() {
			ts.Stop()
		})

		Context("enable-diego", func() {
Пример #2
0
		err         error
	)

	BeforeEach(func() {
		rpcHandlers = &fake_rpc_handlers.FakeHandlers{}
		ts, err = test_rpc_server.NewTestRpcServer(rpcHandlers)
		Ω(err).NotTo(HaveOccurred())

		err = ts.Start()
		Ω(err).NotTo(HaveOccurred())

		//set rpc.CallCoreCommand to a successful call
		//rpc.CallCoreCommand is used in both cliConnection.CliCommand() and
		//cliConnection.CliWithoutTerminalOutput()
		rpcHandlers.CallCoreCommandStub = func(_ []string, retVal *bool) error {
			*retVal = true
			return nil
		}

		//set rpc.GetOutputAndReset to return empty string; this is used by CliCommand()/CliWithoutTerminalOutput()
		rpcHandlers.GetOutputAndResetStub = func(_ bool, retVal *[]string) error {
			*retVal = []string{"{}"}
			return nil
		}
	})

	AfterEach(func() {
		ts.Stop()
	})

	Describe("list-apps", func() {
		Context("Option flags", func() {