爱意满满的作品展示区。
lianghui

分享 http dsl 测试工具库

  •  
  •   lianghui ·
    whiteclover · Feb 15, 2015 · 2739 views
    This topic created in 4103 days ago, the information mentioned may be changed or developed.
    年前小分享,借鉴了twill的dsl灵感,库现在主要用来做mobile端或者api化的平台冒烟测试。

    实现的化主要是python的metaclass,与正则及模板化

    1. 支持python testcase doc test
    2. dsl文件测试
    3. 自动跟踪保持cookies

    戳: https://github.com/thomashuang/natume


    demo:


    [initialize]

    @key = "苏打绿"

    [index]
    > GET /

    content <- 虾米音乐网(xiami.com)


    [song api]
    > GET /song/playlist/id/1772167572/type/0/cat/json

    content_type: application/json
    charset: utf-8

    json: ['data']['trackList'][0]['title'] = u'再遇见'
    json: ['data']['trackList'][0]['song_id'] = '1772167572'
    json: ['data']['type_id'] = 1

    [search]
    > GET /search/collect key='苏打绿'

    code: 200
    content <- 苏打绿歌曲: 最好听的苏打绿音乐试听
    content =~ /Xiami.com/i


    [search page 2]
    > GET /search/collect/page/2 key=@key order='weight'

    code: 200
    content <- 苏打绿歌曲: 最好听的苏打绿音乐试听
    content =~ /XiaMi.com/i
    2 replies    2015-02-28 09:31:56 +08:00
    semicircle21
        1
    semicircle21  
       Feb 18, 2015
    你是在之前分享过一次思路的那位吗?
    现在实现了?
    lianghui
        2
    lianghui  
    OP
       Feb 28, 2015
    @semicircle21 是的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4591 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 10:10 · PVG 18:10 · LAX 03:10 · JFK 06:10
    ♥ Do have faith in what you're doing.