本文整理汇总了Python中nose.tools.trivial.ok_函数的典型用法代码示例。如果您正苦于以下问题:Python ok_函数的具体用法?Python ok_怎么用?Python ok_使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ok_函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: step_impl
def step_impl(context):
"""
:type context behave.runner.Context
"""
time.sleep(0.01)
ok_(context.worker_handler.message['schemaRef'] == "ref://of.message.message" and
context.worker_handler.message['data'] == context.message["data"])
开发者ID:OptimalBPM,项目名称:optimalbpm,代码行数:7,代码来源:messaging.py
示例2: test_talbot_with_shift
def test_talbot_with_shift():
"""test for Talbot numerical inverse Laplace with shift"""
a = Talbot(f=f3, n=24, shift=1.0, dps=None)
#single value of t:
ok_(mpallclose(a(1), mpmath.exp(mpmath.mpf('1.0'))))
开发者ID:rtrwalker,项目名称:geotecha,代码行数:7,代码来源:test_mp_laplace.py
示例3: step_impl
def step_impl(context):
"""
:type context behave.runner.Context
"""
def replace_attribute(parent, attribute, new_value):
parent.pop(attribute)
parent.update(new_value)
# Completely manually resolve the group schema (this for the test to work better even if minor changes to the schemas are made)
type_schema = json_load_file(os.path.join(script_location, "../../namespaces/of/type.json"))
objectId_def = type_schema["properties"]["objectId"]
uuid_def = type_schema["properties"]["uuid"]
datetime_def = type_schema["properties"]["datetime"]
node_schema = json_load_file(os.path.join(script_location, "../../namespaces/of/node/node.json"))
manually_resolved_node_properties = node_schema["properties"]
replace_attribute(manually_resolved_node_properties["_id"],"$ref", objectId_def)
replace_attribute(manually_resolved_node_properties["parent_id"],"$ref", objectId_def)
replace_attribute(manually_resolved_node_properties["canRead"]["items"],"$ref", objectId_def)
replace_attribute(manually_resolved_node_properties["canWrite"]["items"],"$ref", objectId_def)
group_schema = json_load_file(os.path.join(script_location, "../../namespaces/of/node/group.json"))
manually_resolved_group = deepcopy(group_schema)
del manually_resolved_group["allOf"]
manually_resolved_group["properties"] = node_schema["properties"]
manually_resolved_group["properties"].update(group_schema["allOf"][1]["properties"])
replace_attribute(manually_resolved_group["properties"]["rights"]["items"],"$ref", objectId_def)
ok_(context.resolvedGroupSchema == manually_resolved_group)
开发者ID:OptimalBPM,项目名称:of,代码行数:31,代码来源:schema.py
示例4: test_line_labels
def test_line_labels(self):
fig = plot_vs_depth(self.x,self.z, ['a', 'b', 'c'])
ax = fig.get_axes()[0]
assert_allclose(ax.get_lines()[0].get_xydata(),
np.array([[ 1., 0.],
[ 3., 2.],
[ 5., 4.],
[ 7., 6.],
[ 9., 8.]]))
assert_allclose(ax.get_lines()[1].get_xydata(),
np.array([[ 2., 0.],
[ 4., 2.],
[ 6., 4.],
[ 8., 6.],
[ 10., 8.]]))
assert_allclose(ax.get_lines()[2].get_xydata(),
np.array([[ 3., 0.],
[ 5., 2.],
[ 7., 4.],
[ 9., 6.],
[ 11., 8.]]))
assert_equal(ax.get_lines()[0].get_label(), 'a')
assert_equal(ax.get_lines()[1].get_label(), 'b')
assert_equal(ax.get_lines()[2].get_label(), 'c')
ok_(not ax.get_legend() is None)
assert_equal(ax.get_legend().get_title().get_text(), 'time:')
开发者ID:mikyes,项目名称:geotecha,代码行数:28,代码来源:test_one_d.py
示例5: step_impl
def step_impl(context):
"""
:type context behave.runner.Context
"""
context.original_definition = context.node.find({"name" : "Test_Process_definition_CHANGED"}, context.user)[0]
_result = context.control.remove_process_definition(context.original_definition["_id"], context.user)
ok_(True)
开发者ID:OptimalBPM,项目名称:optimalbpm,代码行数:7,代码来源:process_definitions.py
示例6: test_talbot_with_more_complicated
def test_talbot_with_more_complicated():
"""test for Talbot numerical inverse Laplace with sin"""
a = Talbot(f=f4, n=24, shift=0, dps=None)
#single value of t:
ok_(mpallclose(a(2, args=(1,)),
mpmath.mpf('2.0')*mpmath.sin(mpmath.mpf('2.0'))))
开发者ID:rtrwalker,项目名称:geotecha,代码行数:8,代码来源:test_mp_laplace.py
示例7: test_pickle_std
def test_pickle_std(self):
""" sts.stdin のラッパーオブジェクトの Pickle を確認する """
wrapper = FileObjectWrapper(sys.stdin)
binary = pickle.dumps(wrapper)
restored_object = pickle.loads(binary)
ok_(hasattr(restored_object.file, "read"))
开发者ID:momijiame,项目名称:jpgrep,代码行数:8,代码来源:test_util.py
示例8: step_impl
def step_impl(context):
"""
:type context behave.runner.Context
"""
ok_(check_session(context.session_id) is not None)
开发者ID:OptimalBPM,项目名称:of,代码行数:8,代码来源:authentication.py
示例9: test_talbot_dps_fail
def test_talbot_dps_fail():
"test for Talbot numerical inverse Laplace with mpmath insufficient dps"
a = Talbot(f=f1, n=200, shift=0.0, dps=None)
#t=0 raise error:
assert_raises(ValueError, a, 0)
#single value of t:
ok_(not mpallclose(a(1), mpmath.exp(mpmath.mpf('-1.0'))))
开发者ID:rtrwalker,项目名称:geotecha,代码行数:8,代码来源:test_mp_laplace.py
示例10: step_impl
def step_impl(context):
"""
:type context: behave.runner.Context
"""
global _global_err_cmp, _global_debug_cmp, _global_err_param, _global_debug_param
_debug_msg = make_textual_log_message(*_global_debug_param)
ok_(_debug_msg == _global_debug_cmp, "Debug message did not match: \nResult:" + str(_debug_msg.encode()) + "\nComparison:\n" + str(_global_debug_cmp.encode()))
开发者ID:OptimalBPM,项目名称:of,代码行数:8,代码来源:logging.py
示例11: step_impl
def step_impl(context):
"""
:type context behave.runner.Context
"""
time.sleep(0.01)
context.log_item = \
context.db_access.find({"conditions": {"processId": context.process_instance["_id"]}, "collection": "log"},
context.user)[0]
ok_(True)
开发者ID:OptimalBPM,项目名称:of,代码行数:9,代码来源:broker_monitor.py
示例12: step_impl
def step_impl(context):
"""
:type context behave.runner.Context
"""
try:
context.TestInstance.not_implemented_function()
ok_(False)
except NotImplementedError:
ok_(True)
开发者ID:OptimalBPM,项目名称:of,代码行数:9,代码来源:internal.py
示例13: test_get_client_integration
def test_get_client_integration(self):
sys.argv = [
'cmonkey',
'-t', 'integration',
'listUsers',
]
args = _parse_args()
client = _get_client(args)
ok_(isinstance(client, IntegrationClient))
开发者ID:hkwi,项目名称:cmonkey,代码行数:9,代码来源:__init__.py
示例14: test_save_data_grid_data_dicts
def test_save_data_grid_data_dicts(self):
a = InputFileLoaderCheckerSaver()
a._grid_data_dicts= {'data': np.arange(6).reshape(3,2)}
a.save_data_to_file=True
a._save_data()
# print(os.listdir(os.path.join(self.tempdir.path,'out0002')))
ok_(os.path.isfile(os.path.join(
self.tempdir.path, 'out0002','out0002.csv')))
开发者ID:rtrwalker,项目名称:geotecha,代码行数:9,代码来源:test_inputoutput.py
示例15: test_save_data_input_ext
def test_save_data_input_ext(self):
a = InputFileLoaderCheckerSaver()
a._input_text= "hello"
a.input_ext= '.txt'
a.save_data_to_file=True
a._save_data()
ok_(os.path.isfile(os.path.join(
self.tempdir.path, 'out0002','out0002_input_original.txt')))
开发者ID:rtrwalker,项目名称:geotecha,代码行数:9,代码来源:test_inputoutput.py
示例16: step_impl
def step_impl(context):
"""
:type context behave.runner.Context
"""
print("Took " + str(
(context.tests_ended - context.tests_started) * 1000) + " milliseconds.")
ok_(context.process_result["result"] == {"result": "result"} and
context.process_result["globals"] == {"context": "context"})
开发者ID:OptimalBPM,项目名称:optimalbpm,代码行数:9,代码来源:process_control.py
示例17: test_std
def test_std(self):
""" sys.stdin からラッパーオブジェクトを作る """
wrapper = FileObjectWrapper(sys.stdin)
eq_(wrapper.name, "<stdin>")
ok_(hasattr(wrapper.file, "read"))
with wrapper.file as _:
pass
开发者ID:momijiame,项目名称:jpgrep,代码行数:9,代码来源:test_util.py
示例18: test_defaults
def test_defaults(self):
fig = plot_generic_loads([[self.triple1], [self.triple2]],
load_names=self.load_names)
assert_equal(len(fig.get_axes()), 4)
ax1 = fig.get_axes()[0]
line1= ax1.get_lines()[0]
ax2 = fig.get_axes()[1]
line2 = ax2.get_lines()[0]
ax3 = fig.get_axes()[2]
line3 = ax3.get_lines()[0]
ax4 = fig.get_axes()[3]
line4 = ax4.get_lines()[0]
#first row of charts
assert_allclose(line1.get_xydata()[0],
np.array([ 0, 0]))
assert_allclose(line1.get_xydata()[-1],
np.array([ 10, 1*np.cos(0.5*10+0.3)]))
assert_allclose(line2.get_xydata()[0],
np.array([ 1, 0]))
assert_allclose(line2.get_xydata()[-1],
np.array([ 0.5, 1]))
#2nd row of charts
assert_allclose(line3.get_xydata()[0],
np.array([ 0, 0]))
assert_allclose(line3.get_xydata()[-1],
np.array([ 9, 2]))
assert_allclose(line4.get_xydata()[0],
np.array([ 1, 0]))
assert_allclose(line4.get_xydata()[-1],
np.array([ 0.8, 1]))
assert_equal(ax1.get_xlabel(), '')
assert_equal(ax1.get_ylabel(), 'y0')
assert_equal(ax2.get_xlabel(), '')
assert_equal(ax2.get_ylabel(), 'Depth, z')
assert_equal(ax3.get_xlabel(), 'Time')
assert_equal(ax3.get_ylabel(), 'y1')
assert_equal(ax4.get_xlabel(), 'Load factor')
assert_equal(ax4.get_ylabel(), 'Depth, z')
assert_equal(line1.get_label(), 'a0')
assert_equal(line2.get_label(), 'a0')
assert_equal(line3.get_label(), 'b0')
assert_equal(line4.get_label(), 'b0')
ok_(not ax1.get_legend() is None)
ok_(not ax3.get_legend() is None)
开发者ID:mikyes,项目名称:geotecha,代码行数:56,代码来源:test_one_d.py
示例19: test_get_client_default
def test_get_client_default(self):
sys.argv = [
'cmonkey',
'-a', 'foo',
'-s', 'bar',
'listUsers',
]
args = _parse_args()
client = _get_client(args)
ok_(isinstance(client, SignatureClient))
开发者ID:hkwi,项目名称:cmonkey,代码行数:10,代码来源:__init__.py
示例20: test_object_members
def test_object_members():
"""test for object_members function"""
import math
ok_(set(['acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh',
'ceil', 'copysign', 'cos', 'cosh', 'degrees', 'erf', 'erfc',
'exp', 'expm1', 'fabs', 'factorial', 'floor', 'fmod',
'frexp', 'fsum', 'gamma', 'hypot', 'isinf', 'isnan', 'ldexp',
'lgamma', 'log', 'log10', 'log1p', 'modf', 'pow', 'radians',
'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc']).issubset(
set(object_members(math, 'routine', join=False))))
开发者ID:rtrwalker,项目名称:geotecha,代码行数:10,代码来源:test_inputoutput.py
注:本文中的nose.tools.trivial.ok_函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论