|
@@ -17,20 +17,17 @@ func TestPools(t *testing.T) {
|
|
|
pushingPool: make(map[string]*progressreader.ProgressStatus),
|
|
|
}
|
|
|
|
|
|
- if _, err := s.poolAdd("pull", "test1"); err != nil {
|
|
|
- t.Fatal(err)
|
|
|
- }
|
|
|
- if _, err := s.poolAdd("pull", "test2"); err != nil {
|
|
|
- t.Fatal(err)
|
|
|
+ if _, found := s.poolAdd("pull", "test1"); found {
|
|
|
+ t.Fatal("Expected pull test1 not to be in progress")
|
|
|
}
|
|
|
- if _, err := s.poolAdd("push", "test1"); err == nil || err.Error() != "pull test1 is already in progress" {
|
|
|
- t.Fatalf("Expected `pull test1 is already in progress`")
|
|
|
+ if _, found := s.poolAdd("pull", "test2"); found {
|
|
|
+ t.Fatal("Expected pull test2 not to be in progress")
|
|
|
}
|
|
|
- if _, err := s.poolAdd("pull", "test1"); err == nil || err.Error() != "pull test1 is already in progress" {
|
|
|
- t.Fatalf("Expected `pull test1 is already in progress`")
|
|
|
+ if _, found := s.poolAdd("push", "test1"); !found {
|
|
|
+ t.Fatalf("Expected pull test1 to be in progress`")
|
|
|
}
|
|
|
- if _, err := s.poolAdd("wait", "test3"); err == nil || err.Error() != "Unknown pool type" {
|
|
|
- t.Fatalf("Expected `Unknown pool type`")
|
|
|
+ if _, found := s.poolAdd("pull", "test1"); !found {
|
|
|
+ t.Fatalf("Expected pull test1 to be in progress`")
|
|
|
}
|
|
|
if err := s.poolRemove("pull", "test2"); err != nil {
|
|
|
t.Fatal(err)
|
|
@@ -44,7 +41,4 @@ func TestPools(t *testing.T) {
|
|
|
if err := s.poolRemove("push", "test1"); err != nil {
|
|
|
t.Fatal(err)
|
|
|
}
|
|
|
- if err := s.poolRemove("wait", "test3"); err == nil || err.Error() != "Unknown pool type" {
|
|
|
- t.Fatalf("Expected `Unknown pool type`")
|
|
|
- }
|
|
|
}
|