Procházet zdrojové kódy

Merge pull request #7622 from rajdeepd/master

Added Test case for Engine shutdown
Michael Crosby před 11 roky
rodič
revize
2bdfbab23d
1 změnil soubory, kde provedl 11 přidání a 0 odebrání
  1. 11 0
      engine/engine_test.go

+ 11 - 0
engine/engine_test.go

@@ -61,6 +61,17 @@ func TestJob(t *testing.T) {
 	}
 	}
 }
 }
 
 
+func TestEngineShutdown(t *testing.T) {
+	eng := New()
+	if eng.IsShutdown() {
+		t.Fatalf("Engine should not show as shutdown")
+	}
+	eng.Shutdown()
+	if !eng.IsShutdown() {
+		t.Fatalf("Engine should show as shutdown")
+	}
+}
+
 func TestEngineCommands(t *testing.T) {
 func TestEngineCommands(t *testing.T) {
 	eng := New()
 	eng := New()
 	handler := func(job *Job) Status { return StatusOK }
 	handler := func(job *Job) Status { return StatusOK }