Included gomill framework for SGF and GTP support, and sketched out SGF game-loading code.

This commit is contained in:
Anna Rose Wiggins 2012-04-21 04:27:05 -04:00
parent 700a6a2f32
commit 692dc294d6
119 changed files with 27458 additions and 3 deletions

View file

@ -0,0 +1,29 @@
"""Tests for settings.py"""
from gomill.settings import *
from gomill_tests import gomill_test_support
def make_tests(suite):
suite.addTests(gomill_test_support.make_simple_tests(globals()))
def test_interpret_shlex_sequence(tc):
iss = interpret_shlex_sequence
tc.assertEqual(iss("test"), ["test"])
tc.assertEqual(iss("test "), ["test"])
tc.assertEqual(iss("~test"), ["~test"])
tc.assertEqual(iss("test foo bar"), ["test", "foo", "bar"])
tc.assertEqual(iss("test 'foo bar'"), ["test", "foo bar"])
tc.assertEqual(iss(u"test foo bar"), ["test", "foo", "bar"])
tc.assertEqual(iss(["test"]), ["test"])
tc.assertEqual(iss(["test", "foo", "bar"]), ["test", "foo", "bar"])
tc.assertEqual(iss(["test", "foo bar"]), ["test", "foo bar"])
tc.assertEqual(iss(("test", "foo", "bar")), ["test", "foo", "bar"])
tc.assertRaisesRegexp(ValueError, "^empty$", iss, "")
tc.assertRaisesRegexp(ValueError, "^not a string or a sequence$", iss, None)
tc.assertRaisesRegexp(ValueError, "^element not a string$",
iss, ["test", None])
tc.assertRaisesRegexp(ValueError, "^element contains NUL$",
iss, ["test", "fo\x00"])