Tangram
语言
  • What is Tangram?
  • overview
    • Capabilities
    • Architecture
  • Install
    • Start with Kubernetes
  • quick start
    • Create a flow
    • Create a tool
  • Flow
    • Nodes
      • IF
      • SWITCH
      • Format
      • Count
      • Subflow
      • Conversion
      • Execution
      • Variable
      • Note
      • Error
      • Response
    • Datasources
      • Node
      • Form
      • Variable
      • Webhooks
      • Inputs(Subflow)
      • Base
  • triggers
    • Forms
      • Text
      • Textarea
      • Number
      • Date
      • Radio
      • Checkbox
      • Single Selection
      • Multi Selection
      • File
      • Title and Content
    • Webhooks
    • Crons
  • APP Development
    • template
    • info.json
    • core.py
    • test.py
    • Upload and Debugging
Powered by GitBook
On this page
  • Write test cases
  • Run test cases
  1. APP Development

test.py

Develop and debug locally to ensure the application is correct.

After the application is uploaded, it will be automatically deleted.

Write test cases

from unittest import TestCase
from apps.jira.core import Jira

class JiraTestCase(TestCase):

    def setUp(self):
        self.configs = {
            "server": "https://xxx.atlassian.net",
            "email": "xxx@gmail.com",
            "api_token": "xxxxxxxxxxxxxxxxxx"
        }

    def test(self):
        res = Jira(self.configs).do_action(name="test", params={})
        print(res)

    def test_get_projects(self):
        res = Jira(self.configs).do_action(name="get_projects", params={})
        print(res)

    def test_get_project(self):
        res = Jira(self.configs).do_action(name="get_project", params={ "id": "DESK" })
        print(res)

Run test cases

./manage.py test apps.jira.test
Previouscore.pyNextUpload and Debugging

Last updated 10 months ago