diff options
| author | Shulhan <ms@kilabit.info> | 2022-06-09 23:44:02 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2022-06-09 23:44:02 +0700 |
| commit | 5c354863c9c6fcc080f2407e6f7adea41fa4371d (patch) | |
| tree | b892e13340335436e6a785a9267e080f937b10f8 /environment_test.go | |
| parent | 03ae9f6bfde5262b44d2318cc1162c20d867a3f6 (diff) | |
| download | rescached-5c354863c9c6fcc080f2407e6f7adea41fa4371d.tar.xz | |
all: add integration tests for HTTP API related to block.d
The test is conducted by running the server and call the HTTP API using
the Client methods.
Diffstat (limited to 'environment_test.go')
| -rw-r--r-- | environment_test.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/environment_test.go b/environment_test.go index 99d0950..467bd5b 100644 --- a/environment_test.go +++ b/environment_test.go @@ -74,17 +74,17 @@ func TestLoadEnvironment(t *testing.T) { WUIListen: "127.0.0.1:5381", HostBlockd: map[string]*Blockd{ - "pgl.yoyo.org": &Blockd{ - Name: "pgl.yoyo.org", - URL: `http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&startdate[day]=&startdate[month]=&startdate[year]=&mimetype=plaintext`, + "a.block": &Blockd{ + Name: "a.block", + URL: "http://127.0.0.1:11180/hosts/a", }, - "winhelp2002.mvps.org": &Blockd{ - Name: "winhelp2002.mvps.org", - URL: `http://winhelp2002.mvps.org/hosts.txt`, + "b.block": &Blockd{ + Name: "b.block", + URL: "http://127.0.0.1:11180/hosts/b", }, - "someonewhocares.org": &Blockd{ - Name: "someonewhocares.org", - URL: `http://someonewhocares.org/hosts/hosts`, + "c.block": &Blockd{ + Name: "c.block", + URL: "http://127.0.0.1:11180/hosts/c", }, }, HttpdOptions: &libhttp.ServerOptions{ @@ -130,5 +130,5 @@ func TestLoadEnvironment(t *testing.T) { t.Fatal(err) } - test.Assert(t, "Write", expBuffer, gotBuffer.Bytes()) + test.Assert(t, "Write", string(expBuffer), gotBuffer.String()) } |
