// TestSubmitTask tests that client.SubmitTask(...) adds a task to
// the proper path in etcd, and that the same task id cannot be
// submitted more than once.
TestSubmitTask tests that client.SubmitTask(...) adds a task to
the proper path in etcd, and that the same task id cannot be
submitted more than once.
// TestSubmitTask tests that client . SubmitTask ( ... ) adds a task to // the proper path in etcd and that the same task id cannot be // submitted more than once .
func TestSubmitTask(t *testing.T) {
	client := testutil.NewEtcdV3Client(t)
	mclient := NewClient(Namespace, client)
	task := DefaultTaskFunc("testid1", "")
	if err := mclient.DeleteTask(task.ID()); err != nil {
		t.Logf("DeleteTask returned an error, which maybe ok.  Error:%v", err)
	}
	if err := mclient.SubmitTask(task); err != nil {
		t.Fatalf("Submit task failed on initial submission, error: %v", err)
	}
	if err := mclient.SubmitTask(task); err == nil {
		t.Fatalf("Submit task did not fail, but should of, when using existing tast id")
	}
}
func TestSubmitTask ( t * testing . T ) { client := testutil . NewEtcdV3Client ( t ) mclient := NewClient ( Namespace , client ) task := DefaultTaskFunc ( " " , " " ) if err := mclient . DeleteTask ( task . ID ( ) ) ; err != nil { t . Logf ( " " , err ) } if err := mclient . SubmitTask ( task ) ; err != nil { t . Fatalf ( " " , err ) } if err := mclient . SubmitTask ( task ) ; err == nil { t . Fatalf ( " " ) } }
TestSubmitTask tests that client.SubmitTask(...) adds a task to
the proper path in etcd, and that the same task id cannot be
submitted more than once.
TestSubmitTask tests that client . SubmitTask ( ... ) adds a task to the proper path in etcd and that the same task id cannot be submitted more than once .