forked from adjust/goenv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathamqp_test.go
33 lines (28 loc) · 917 Bytes
/
amqp_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package goenv
import (
"testing"
)
func TestGetAmqp(t *testing.T) {
goenv := NewGoenv("./test_config.yml", "amqp", "nil")
if goenv.GetAmqp() != "amqp://uhe:roh@hih:870/" {
t.Error("amqp != amqp://uhe:roh@hih:870/")
}
}
func TestGetAmqpNotFound(t *testing.T) {
goenv := NewGoenv("./test_config.yml", "nonexistent", "nil")
if goenv.GetAmqp() != "amqp://guest:guest@localhost:5672/" {
t.Error("amqp != amqp://guest:guest@localhost:5672/")
}
}
func TestGetNamedAmqp(t *testing.T) {
goenv := NewGoenv("./test_config.yml", "amqp", "nil")
if goenv.GetNamedAmqp("custom") != "amqp://rtn:kbo@aar:473/" {
t.Error("namedAmqp != amqp://rtn:kbo@aar:473/")
}
}
func TestGetNamedAmqpNotFound(t *testing.T) {
goenv := NewGoenv("./test_config.yml", "amqp", "nil")
if goenv.GetNamedAmqp("nonexistent") != "amqp://guest:guest@localhost:5672/" {
t.Error("nonexistent != amqp://guest:guest@localhost:5672/")
}
}