Giter Club home page Giter Club logo

eostestmonster's Introduction

eostestmonster

Collection of EOSIO function testcase scripts from the community.

Main functionatily of this project is to test the function of the eosio-mainnet conveniently.

We choose to use Python3 for future.

点击查看中文

Principle

startmonster.py will call in a loop and merge common_params with the param specified by testcase, stored in a file in the ./tmp directory, passed as the first argument when calling cmdline, and then parsed through the program in the testcase folder.

Steps:

  1. Add testcase information and the corresponding parameters in config.json

  2. Create the function you want to test in the testcases/ folder.

    Demo config.json:

    {
      "common_params": {
        "nodeos_url": "http://127.0.0.1:8888",
        "wallet_url": "http://127.0.0.1:9800",
        "exist_account": "eosttmonster",
        "exist_acct_active_pub": "EOS8TfBSfwjPeKCgUfCCEfJPx1UhP2CS1Xh8xoYoELtkQJQ9g99vP",
        "exist_acct_active_pri": "5KdJZv62ZKzxhasNSojk7gC712pF9sRad4KhVyugg442qYvhWYw",
        "req_timeout": 3
      },
      "testcases": [
        {
          "casename": "Testcase Demo",
          "pre_call": "echo 'This is called BEFORE cmdline call'",
          "post_call": "echo 'This is called AFTER cmdline call'",
          "stoponfail": "true",
          "cmdline": "python testcases/testcasedemo.py",
          "params": {
            "demo_param1": "demo_param1",
            "demo_param2": 100
          }
        }
      ]
    }
    
  3. run startmoster.py

    python3 ./startmoster.py
    

image

  1. http-client api tool

    • Postion: /eosapi/httpapi

    • Directory

      • client.py -> this file work for call api function.
      • exceptions.py -> this file work for custom exception
      • http_client.py -> this file work for base http client class. client.py inherit it.
      • util/ -> this directory work for add common function.
    • Example

       client = Client(['http://eosdapp.oneeos.org:8000'])
       res1 = client.get_transaction('c6a6733df77c27094f9f65591f9ce783262b73c2a796aec69ea20545e5dce0e8')
       print(res1)
       res3 = client.stream_blocks()
       for item in res3:
           print(item)
       print(res3)
       client.get_info()
       client.get_currency_stats('eosio.token','EOS')
       client.get_code('zhangzhichao')
       client.get_block(10)
       client.get_actions('zhangzhichao',1,10)  # need open filter_on params when you run nodeos
       client.get_currency_balance('eosio.token','zhangzhichao','EOS')
      

eostestmonster's People

Contributors

eosbixin avatar noprom avatar threadshare avatar winlin avatar zsq978663747 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.