diff options
author | zelig <viktor.tron@gmail.com> | 2015-06-23 22:48:33 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-07-07 16:43:31 +0800 |
commit | 83ee39448e0f23d42dff27bccde27f828afa3707 (patch) | |
tree | 429fa8f20a4bc017a58ffc4c7c0ed8596d1d206f /common/docserver/docserver_test.go | |
parent | d764bd058457cd9eb91d205d1ac187d40c4866d6 (diff) | |
download | dexon-83ee39448e0f23d42dff27bccde27f828afa3707.tar dexon-83ee39448e0f23d42dff27bccde27f828afa3707.tar.gz dexon-83ee39448e0f23d42dff27bccde27f828afa3707.tar.bz2 dexon-83ee39448e0f23d42dff27bccde27f828afa3707.tar.lz dexon-83ee39448e0f23d42dff27bccde27f828afa3707.tar.xz dexon-83ee39448e0f23d42dff27bccde27f828afa3707.tar.zst dexon-83ee39448e0f23d42dff27bccde27f828afa3707.zip |
Registrar and contractInfo handling
* resolver -> common/registrar
* global registrar name registry interface
* add Call to resolver backend interface
* the hashReg and UrlHing contracts now initialised from global registry
* initialization of contracts uniform
* improve errors and more econsistent method names
* common/registrar/ethreg: versioned registrar
* integrate new naming and registrar in natspec
* js console api: setGlobalRegistrar, setHashReg, setUrlHint
* js test TestContract uses mining - tests fixed all pass
* eth/backend: allow PoW test mode (small ethash DAG)
* console jsre refers to resolver.abi/addr,
* cmd/geth/contracts.go moved to common/registrar
Diffstat (limited to 'common/docserver/docserver_test.go')
-rw-r--r-- | common/docserver/docserver_test.go | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/common/docserver/docserver_test.go b/common/docserver/docserver_test.go index 400d7447a..09b16864a 100644 --- a/common/docserver/docserver_test.go +++ b/common/docserver/docserver_test.go @@ -2,6 +2,7 @@ package docserver import ( "io/ioutil" + "net/http" "os" "testing" @@ -15,7 +16,7 @@ func TestGetAuthContent(t *testing.T) { copy(hash[:], crypto.Sha3([]byte(text))) ioutil.WriteFile("/tmp/test.content", []byte(text), os.ModePerm) - ds, err := New("/tmp/") + ds := New("/tmp/") content, err := ds.GetAuthContent("file:///test.content", hash) if err != nil { t.Errorf("no error expected, got %v", err) @@ -36,3 +37,18 @@ func TestGetAuthContent(t *testing.T) { } } + +type rt struct{} + +func (rt) RoundTrip(req *http.Request) (resp *http.Response, err error) { return } + +func TestRegisterScheme(t *testing.T) { + ds := New("/tmp/") + if ds.HasScheme("scheme") { + t.Errorf("expected scheme not to be registered") + } + ds.RegisterScheme("scheme", rt{}) + if !ds.HasScheme("scheme") { + t.Errorf("expected scheme to be registered") + } +} |