예제 #1
0
    def test_patch(self):
        flow = tutils.tflow(req=req_patch)
        result = '    ' + """
    @task()
    def path(self):
        url = self.locust.host + '/path'
        
        headers = {
            'header': 'qvalue',
            'content-length': '7',
        }

        params = {
            'query': 'param',
        }

        data = '''content'''

        self.response = self.client.request(
            method='PATCH',
            url=url,
            headers=headers,
            params=params,
            data=data,
        )
        """.strip() + '\n'

        assert flow_export.locust_task(flow) == result
예제 #2
0
    def test_patch(self):
        flow = tutils.tflow(req=req_patch)
        result = '    ' + """
    @task()
    def path(self):
        url = self.locust.host + '/path'
        
        headers = {
            'header': 'qvalue',
            'content-length': '7',
        }

        params = {
            'query': 'param',
        }

        data = '''content'''

        self.response = self.client.request(
            method='PATCH',
            url=url,
            headers=headers,
            params=params,
            data=data,
        )
        """.strip() + '\n'

        assert flow_export.locust_task(flow) == result
예제 #3
0
    def test_post(self):
        flow = tutils.tflow(req=req_post)
        result = '    ' + """
    @task()
    def path(self):
        url = self.locust.host + '/path'
        
        data = '''content'''

        self.response = self.client.request(
            method='POST',
            url=url,
            data=data,
        )
        """.strip() + '\n'

        assert flow_export.locust_task(flow) == result
예제 #4
0
    def test_post(self):
        flow = tutils.tflow(req=req_post)
        result = '    ' + """
    @task()
    def path(self):
        url = self.locust.host + '/path'
        
        data = '''content'''

        self.response = self.client.request(
            method='POST',
            url=url,
            data=data,
        )
        """.strip() + '\n'

        assert flow_export.locust_task(flow) == result
예제 #5
0
    def test_get(self):
        flow = tutils.tflow(req=req_get)
        result = '    ' + """
    @task()
    def path(self):
        url = self.locust.host + '/path'
        
        headers = {
            'header': 'qvalue',
            'content-length': '7',
        }

        self.response = self.client.request(
            method='GET',
            url=url,
            headers=headers,
        )
        """.strip() + '\n'

        assert flow_export.locust_task(flow) == result
예제 #6
0
    def test_get(self):
        flow = tutils.tflow(req=req_get)
        result = '    ' + """
    @task()
    def path(self):
        url = self.locust.host + '/path'
        
        headers = {
            'header': 'qvalue',
            'content-length': '7',
        }

        self.response = self.client.request(
            method='GET',
            url=url,
            headers=headers,
        )
        """.strip() + '\n'

        assert flow_export.locust_task(flow) == result
예제 #7
0
 def test_patch(self):
     flow = tutils.tflow(req=req_patch())
     python_equals("test_flow_export/locust_task_patch.py", flow_export.locust_task(flow))
예제 #8
0
 def test_get(self):
     flow = tutils.tflow(req=req_get())
     python_equals("test_flow_export/locust_task_get.py", flow_export.locust_task(flow))