本文整理汇总了Python中t.eq函数的典型用法代码示例。如果您正苦于以下问题:Python eq函数的具体用法?Python eq怎么用?Python eq使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eq函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_plumbing
def test_plumbing(inq, outq, proc):
data = get_simple_data(100)
i = 0
for sample in send_get_data(data, inq, outq):
t.eq(sample, data[i])
i += 1
t.eq(i, 100)
示例2: test_filter
def test_filter(inq, outq, proc):
data = get_simple_data(100)
i = 0
for sample in send_get_data(data, inq, outq):
t.eq(sample[2] % 2, 1)
i += 1
t.eq(i, 50)
示例3: test_syntax_error
def test_syntax_error(cx):
try:
cx.execute("function(asdf;")
t.eq(1, 0)
except:
line = traceback.format_exc().split("\n")[-3].strip()
t.eq(line, ERROR)
示例4: test_016
def test_016(u, c):
fn = os.path.join(os.path.dirname(__file__), "1M")
with open(fn, "rb") as f:
l = int(os.fstat(f.fileno())[6])
r = c.request(u, 'POST', body=f)
t.eq(r.status_int, 200)
t.eq(int(r.body), l)
示例5: test_ok
def test_ok(self):
self.TestResource.conflict = False
self.env.method = 'PUT'
self.env.content_type = 'text/html'
self.go()
t.eq(self.rsp.status_code, 200)
t.eq(self.rsp.response, ['bar'])
示例6: test_compiled_contexts
def test_compiled_contexts(rt):
"Check to be sure multiple contexts can be used for compiled execution."
ctx1 = rt.new_context({"a": 111})
ctx2 = rt.new_context({"a": 222})
expr1 = ctx1.compile("a * 3;")
t.eq(expr1.execute(), 333)
t.eq(expr1.execute(ctx2), 666)
示例7: test_update_user
def test_update_user(api):
data = {
"username": "blossom",
"firstname": "Blossom",
"lastname": "Utonium",
"password1": "ng5qhhbiwozcANc3",
"password2": "ng5qhhbiwozcANc3",
"email": "[email protected]",
"timezone": "Africa/Johannesburg",
"account_type": "3",
"domains": "9",
"active": "y",
"send_report": "y",
"spam_checks": "y",
"low_score": "5.0",
"high_score": "10.0",
}
req = api.update_user(data)
path = ENDPOINTS["users"]["update"]["name"]
t.eq(api.response.final_url, "%s%s%s" % (BASE_URL, API_PATH, path))
t.eq(api.response.request.method, ENDPOINTS["users"]["update"]["method"])
t.eq(api.response.status_int, 201)
t.eq(req["low_score"], "5.0")
t.eq(req["high_score"], "10.0")
t.isnotin("password1", req)
示例8: test_ok
def test_ok(self):
self.TestResource.conflict = False
self.req.method = 'PUT'
self.req.content_type = 'text/html'
self.go()
t.eq(self.rsp.status, '200 OK')
t.eq(self.rsp.body, 'bar')
示例9: test_from_func
def test_from_func():
@t.task
def foo():
"Hi"
pass
t.desc(foo, "yay")
t.eq(t.app.mgr.lookup("foo").descr, "yay")
示例10: test_post_is_create_no_redirect
def test_post_is_create_no_redirect(self):
self.TestResource.create = True
self.TestResource.location = None
self.req.method = 'POST'
self.go()
t.eq(self.rsp.status, '200 OK')
t.eq(self.rsp.body, 'created')
示例11: test_override_docstring
def test_override_docstring():
@t.task
def foo():
"Not the description"
pass
t.desc("foo", "wheeee")
t.eq(t.app.mgr.lookup("foo").descr, "wheeee")
示例12: test_add_description_first
def test_add_description_first():
t.desc("foo", "bazinga")
@t.task
def foo():
"Not used as a description"
pass
t.eq(t.app.mgr.lookup("foo").descr, "bazinga")
示例13: test_003
def test_003():
u = "http://test:[email protected]%s:%s/auth" % (HOST, PORT)
r = request(u)
t.eq(r.status_int, 200)
u = "http://test:[email protected]%s:%s/auth" % (HOST, PORT)
r = request(u)
t.eq(r.status_int, 403)
示例14: second
def second(rec):
t.eq(rec.meta, {
'ids': [
('gi', '66816243'),
('ref', 'XP_642131.1'),
('gi', '1705556'),
('sp', 'P54670.1|CAF1_DICDI'),
('gi', '793761'),
('dbj', 'BAA06266.1'),
('gi', '60470106'),
('gb', 'EAL68086.1')
],
'desc': [
'calfumirin-1 [Dictyostelium discoideum AX4]',
'RecName: Full=Calfumirin-1; Short=CAF-1',
'calfumirin-1 [Dictyostelium discoideum]'
]
})
t.eq(rec.id, ('gi', '66816243'))
t.eq(rec.desc, 'calfumirin-1 [Dictyostelium discoideum AX4]')
t.eq(rec.sequence, ''.join("""
MASTQNIVEEVQKMLDTYDTNKDGEITKAEAVEYFKGKKAFNPERSAIYLFQVYDKDNDGKITIKELA
GDIDFDKALKEYKEKQAKSKQQEAEVEEDIEAFILRHNKDDNTDITKDELIQGFKETGAKDPEKSANF
ILTEMDTNKDGTITVKELRVYYQKVQKLLNPDQ
""".split()))
t.eq(rec.hash, "7D6B32F721E2E8BF34A37015C11E3FBAA0C791B8")
示例15: test_raw_yaml
def test_raw_yaml():
yaml = dedent("""\
name: test
sql: SELECT 'x' as "foo"
""")
conn = t.sheba.connect(yaml, driver='sqlite3', args=(":memory:",))
t.eq(isinstance(conn, t.Connection), True)