• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python t.eq函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中t.eq函数的典型用法代码示例。如果您正苦于以下问题:Python eq函数的具体用法?Python eq怎么用?Python eq使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了eq函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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)
开发者ID:dimrozakis,项目名称:bucky,代码行数:7,代码来源:test_003_processor.py


示例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)
开发者ID:dimrozakis,项目名称:bucky,代码行数:7,代码来源:test_003_processor.py


示例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)
开发者ID:EricSchles,项目名称:python-spidermonkey,代码行数:7,代码来源:test-syntax-error.py


示例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)
开发者ID:mwhooker,项目名称:restkit,代码行数:7,代码来源:003-test-client.py


示例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'])
开发者ID:msabramo,项目名称:rapidmachine,代码行数:7,代码来源:p03_test.py


示例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)
开发者ID:smurfix,项目名称:python-spidermonkey,代码行数:7,代码来源:test-compiled.py


示例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)
开发者ID:akissa,项目名称:BaruwaAPI,代码行数:25,代码来源:001-test-users.py


示例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')
开发者ID:benoitc,项目名称:pywebmachine,代码行数:7,代码来源:p03_test.py


示例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")
开发者ID:GaelVaroquaux,项目名称:smithy,代码行数:7,代码来源:007-description-tests.py


示例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')
开发者ID:benoitc,项目名称:pywebmachine,代码行数:7,代码来源:n11_test.py


示例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")
开发者ID:GaelVaroquaux,项目名称:smithy,代码行数:7,代码来源:007-description-tests.py


示例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")
开发者ID:GaelVaroquaux,项目名称:smithy,代码行数:7,代码来源:007-description-tests.py


示例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)
开发者ID:andrewjw,项目名称:restkit,代码行数:7,代码来源:008-test-request.py


示例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")
开发者ID:alepharchives,项目名称:nebfa,代码行数:26,代码来源:test-multi-def.py


示例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)
开发者ID:pombredanne,项目名称:sheba,代码行数:7,代码来源:006-connect-test.py


示例16: test_py_del_global

def test_py_del_global(rt):
    glbl = ActiveGlobalWithDel()
    cx = rt.new_context(glbl)
    cx.execute("foo = 4;")
    t.eq(glbl.data["foo"], 8)
    cx.execute("delete foo;")
    t.isnotin("foo", glbl.data)
开发者ID:spahl,项目名称:python-spidermonkey,代码行数:7,代码来源:test-global.py


示例17: test_nworkers_changed

def test_nworkers_changed():
    c = config.Config()
    def nworkers_changed_3(server, new_value, old_value):
        return 3

    c.set("nworkers_changed", nworkers_changed_3)
    t.eq(3, c.nworkers_changed(1, 2, 3))
开发者ID:1stvamp,项目名称:gunicorn,代码行数:7,代码来源:test_003-config.py


示例18: test_statement_error

def test_statement_error():
    obj = {"name": "test"}
    try:
        t.Statement(obj)
    except t.IncompleteStatementError, e:
        t.eq(e.name, "sql")
        str(e)  # Doesn't raise
开发者ID:pombredanne,项目名称:sheba,代码行数:7,代码来源:002-statement-test.py


示例19: test_py_no_del_item

def test_py_no_del_item(rt):
    glbl = ActiveGlobal()
    cx = rt.new_context(glbl)
    cx.execute('foo = 4;')
    t.eq(glbl.data["foo"], 8)
    cx.execute("delete foo;")
    t.isin("foo", glbl.data)
开发者ID:spahl,项目名称:python-spidermonkey,代码行数:7,代码来源:test-global.py


示例20: test_invalid_native_case

def test_invalid_native_case(conn, cursor):
    try:
        t.dbwrapper.DB_INFO['sqlite'].native_case = "foo"
        cursor.execute("select 1 as a")
    except t.dbwrapper.InvalidNativeCase, inst:
        t.eq(inst.name, "foo")
        str(inst) # Doesn't raise
开发者ID:pombredanne,项目名称:sheba,代码行数:7,代码来源:001-dbwrapper-test.py



注:本文中的t.eq函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python t.raises函数代码示例发布时间:2022-05-27
下一篇:
Python auth.verify_privilege函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap