Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
232671a8
提交
232671a8
authored
2月 23, 2012
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pep8
上级
01b88ba7
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
7 行增加
和
7 行删除
+7
-7
test_optdb.py
theano/gof/tests/test_optdb.py
+7
-7
没有找到文件。
theano/gof/tests/test_optdb.py
浏览文件 @
232671a8
from
theano.gof.optdb
import
*
from
unittest
import
TestCase
from
unittest
import
TestCase
from
theano.gof.optdb
import
opt
,
DB
class
Test_DB
(
TestCase
):
class
Test_DB
(
TestCase
):
def
test_0
(
self
):
def
test_0
(
self
):
class
Opt
(
opt
.
Optimizer
):
#inheritance buys __hash__
class
Opt
(
opt
.
Optimizer
):
#
inheritance buys __hash__
name
=
'blah'
name
=
'blah'
db
=
DB
()
db
=
DB
()
...
@@ -16,7 +18,7 @@ class Test_DB(TestCase):
...
@@ -16,7 +18,7 @@ class Test_DB(TestCase):
db
.
register
(
'c'
,
Opt
(),
'z'
,
'asdf'
)
db
.
register
(
'c'
,
Opt
(),
'z'
,
'asdf'
)
try
:
try
:
db
.
register
(
'c'
,
Opt
())
#
name taken
db
.
register
(
'c'
,
Opt
())
#
name taken
self
.
fail
()
self
.
fail
()
except
ValueError
,
e
:
except
ValueError
,
e
:
if
e
[
0
]
.
startswith
(
"The name"
):
if
e
[
0
]
.
startswith
(
"The name"
):
...
@@ -27,7 +29,7 @@ class Test_DB(TestCase):
...
@@ -27,7 +29,7 @@ class Test_DB(TestCase):
self
.
fail
()
self
.
fail
()
try
:
try
:
db
.
register
(
'z'
,
Opt
())
#
name collides with tag
db
.
register
(
'z'
,
Opt
())
#
name collides with tag
self
.
fail
()
self
.
fail
()
except
ValueError
,
e
:
except
ValueError
,
e
:
if
e
[
0
]
.
startswith
(
"The name"
):
if
e
[
0
]
.
startswith
(
"The name"
):
...
@@ -38,7 +40,7 @@ class Test_DB(TestCase):
...
@@ -38,7 +40,7 @@ class Test_DB(TestCase):
self
.
fail
()
self
.
fail
()
try
:
try
:
db
.
register
(
'u'
,
Opt
(),
'b'
)
#
name new but tag collides with name
db
.
register
(
'u'
,
Opt
(),
'b'
)
#
name new but tag collides with name
self
.
fail
()
self
.
fail
()
except
ValueError
,
e
:
except
ValueError
,
e
:
if
e
[
0
]
.
startswith
(
"The tag"
):
if
e
[
0
]
.
startswith
(
"The tag"
):
...
@@ -47,5 +49,3 @@ class Test_DB(TestCase):
...
@@ -47,5 +49,3 @@ class Test_DB(TestCase):
raise
raise
except
Exception
:
except
Exception
:
self
.
fail
()
self
.
fail
()
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论