当前位置: 首页>>代码示例>>Python>>正文


Python t.eq函数代码示例

本文整理汇总了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)
开发者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


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