Commit 4f7db880 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent eb24bbcc
#!/usr/bin/env python2
"""generate reference index and database for tests"""
import ZODB
import persistent
import transaction
def commit(user, description, extension):
txn = transaction.get()
txn.user = user
txn.description = description
txn.extension = extension
txn.commit()
def main():
stor = FileStorage("testdata/1.fs", create=True)
db = DB(stor)
conn = db.open()
root = conn.root()
commit(u"root", u"initial database creation", {"x-generator": "zodb/py2"})
"""
root["..."] = obj
txn = transaction.get()
txn.user = u"user1" # XXX
txn.description = u"description1" # XXX
txn.extension = {"key1": value1, "key2": value2) # XXX
txn.commit()
"""
conn.close()
db.close()
stor.close()
if __name__ == '__main__':
main()
......@@ -2,10 +2,13 @@
package fs1
//go:generate ./gen-testdata
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"sort"
"strings"
"testing"
......@@ -80,6 +83,7 @@ func treeEqual(a, b *fsb.Tree) bool {
return true
}
// XXX unneded after Tree.Dump() was made to work ok
func treeString(t *fsb.Tree) string {
entryv := []string{}
......@@ -156,7 +160,6 @@ func TestIndexLookup(t *testing.T) {
}
}
//
func TestIndexSaveLoad(t *testing.T) {
workdir, err := ioutil.TempDir("", "t-index")
if err != nil {
......@@ -187,7 +190,18 @@ func TestIndexSaveLoad(t *testing.T) {
//t.Errorf("index load: trees mismatch:\nhave: %v\nwant: %v", treeString(fsi2.Tree), treeString(fsi.Tree))
}
// TODO check with
// {0xb000000000000000, 0x7fffffffffffffff}, // will cause 'entry position too large'
}
var havePyZODB = false
func init() {
cmd := exec.Command("python2", "-c", "import ZODB")
err := cmd.Run()
if err == nil {
havePyZODB = true
}
println("havePyZODB:", havePyZODB)
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment