{"action":"created","comment":{"url":"https://api.github.com/repos/fadu-a/fadu_test_manager/pulls/comments/186596803","pull_request_review_id":118205284,"id":186596803,"diff_hunk":"@@ -0,0 +1,130 @@\n+from django.http import HttpResponse\n+from django.views.decorators.csrf import csrf_exempt\n+from .models import TestIoLogs, TestCases\n+from django.shortcuts import render, redirect\n+import urllib.request\n+import json\n+from urllib.error import HTTPError, URLError\n+from .forms import NewForm\n+from collections import OrderedDict\n+import requests\n+\n+\n+@csrf_exempt\n+def post_results(request, pk):\n+    data = json.loads(request.body)\n+    data[\"test_cases_id\"] = pk\n+    test = TestIoLogs.objects.create(**data)\n+    test.save()\n+    print(\"test\")\n+    return HttpResponse(request.POST)\n+\n+\n+def result_list(request, pk):\n+    servers = list(TestCases.objects.values('Title', 'id'))\n+    print(servers)\n+    servers2 = {}\n+    servers2['datas'] = servers\n+\n+    return render(request, 'results/result_form.html', servers2)\n+\n+\n+def view_detail(request, pk):\n+    data = TestIoLogs.objects.filter(test_cases_id=pk)\n+    data2 = {}\n+    data2['datas'] = data\n+    print(data2)\n+    return render(request, 'results/result_detail.html', data2)\n+\n+\n+def runner_check(request):\n+    URLs = ['http://localhost:3000', 'http://localhost:8000', 'http://localhost:5000']\n+    runners_data = []\n+\n+    for url in URLs:\n+        ip = url.split('//')[1].split(':')[0]\n+        port = url.split(':')[2]\n+        req = urllib.request.Request(url + '/status')\n+        try:\n+            response = urllib.request.urlopen(req)\n+            data = response.read()\n+            encoding = response.info().get_content_charset('utf-8')\n+            info = json.loads(data.decode(encoding))\n+            status = \"Successful\"\n+        except HTTPError as e:\n+            status = \"Failed\"\n+            info = \"\"\n+        except URLError as e:\n+            status = \"Failed\"\n+            info = \"\"\n+        runners_data.append({'ip': ip, 'port': port, 'status': status, 'info': info})\n+    return render(request, 'apps/status.html', {'runners_data': runners_data})\n+\n+\n+def get_index(request):\n+    list = TestCases.objects.all().order_by('-pk')\n+    if request.method == \"POST\":\n+        status = request.POST\n+        return render(request, 'apps/index.html', {'list': list, 'status': status})\n+    else:\n+        return render(request, 'apps/index.html', {'list': list})\n+\n+\n+def detail(request, id):\n+    data = TestCases.objects.filter(id=id)\n+    return render(request, 'apps/detail.html', {'data_list': data})\n+\n+\n+def post_new(request):\n+    if request.method == \"POST\":\n+        request.POST._mutable = True\n+        post_value = request.POST\n+        post_value.update(Configs=json.dumps(post_value['Configs']))\n+        form = NewForm(post_value)\n+        if form.is_valid():\n+            post = form.save(commit=False)\n+            post.Test_group_id = 1\n+            post.save()\n+            return redirect('testcase:index')\n+    else:\n+        form = NewForm()\n+        return render(request, 'apps/new.html', {'form': form})\n+\n+\n+def post_edit(request, id):\n+    if request.method == \"POST\":\n+        request.POST._mutable = True\n+        post_value = request.POST\n+        post_value.update(Configs=json.dumps(post_value['Configs']))\n+        form = NewForm(post_value)\n+        if form.is_valid():\n+            post = form.save(commit=False)\n+            post.id = id\n+            post.Test_group_id = 3\n+            post.save()\n+            return redirect('testcase:index')\n+    else:\n+        row = TestCases.objects.get(id=id)\n+        form = NewForm(initial={'Title': row.Title, 'Description': row.Description, 'Configs': row.Configs})\n+        return render(request, 'apps/edit.html', {'form': form})\n+\n+\n+def delete(id):\n+    delete_value = TestCases.objects.get(id=id)\n+    delete_value.delete()\n+    return redirect('testcase:index')\n+\n+\n+def run_test(request, id, ip, port):\n+    data = TestCases.objects.get(id=id)\n+    configs = data.Configs.split(', ')\n+    dic_configs = OrderedDict()\n+    for list in configs:\n+        list = list.split(':')\n+        dic_configs[list[0]] = list[1]\n+    json_data = json.dumps(dic_configs)\n+    url = 'http://'+ip+':'+port+'/start'\n+    headers = {'content-type':'application/json'}\n+    res = requests.post(url, data = json_data, headers = headers)","path":"apps/views.py","position":128,"original_position":128,"commit_id":"23ca8673495c0193ba76c2e687b4ce2f493e30b2","original_commit_id":"23ca8673495c0193ba76c2e687b4ce2f493e30b2","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"unexpected spaces around keyword / parameter equals","created_at":"2018-05-08T01:33:53Z","updated_at":"2018-05-08T01:33:54Z","html_url":"https://github.com/fadu-a/fadu_test_manager/pull/22#discussion_r186596803","pull_request_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/pulls/22","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/fadu-a/fadu_test_manager/pulls/comments/186596803"},"html":{"href":"https://github.com/fadu-a/fadu_test_manager/pull/22#discussion_r186596803"},"pull_request":{"href":"https://api.github.com/repos/fadu-a/fadu_test_manager/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/fadu-a/fadu_test_manager/pulls/22","id":186505437,"html_url":"https://github.com/fadu-a/fadu_test_manager/pull/22","diff_url":"https://github.com/fadu-a/fadu_test_manager/pull/22.diff","patch_url":"https://github.com/fadu-a/fadu_test_manager/pull/22.patch","issue_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/issues/22","number":22,"state":"open","locked":false,"title":"Develop","user":{"login":"d4vidh","id":24913005,"avatar_url":"https://avatars3.githubusercontent.com/u/24913005?v=4","gravatar_id":"","url":"https://api.github.com/users/d4vidh","html_url":"https://github.com/d4vidh","followers_url":"https://api.github.com/users/d4vidh/followers","following_url":"https://api.github.com/users/d4vidh/following{/other_user}","gists_url":"https://api.github.com/users/d4vidh/gists{/gist_id}","starred_url":"https://api.github.com/users/d4vidh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d4vidh/subscriptions","organizations_url":"https://api.github.com/users/d4vidh/orgs","repos_url":"https://api.github.com/users/d4vidh/repos","events_url":"https://api.github.com/users/d4vidh/events{/privacy}","received_events_url":"https://api.github.com/users/d4vidh/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-08T01:33:35Z","updated_at":"2018-05-08T01:33:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bf3dd976cb3dfb9eaed982d99ceaca47b47dcbe2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/pulls/22/commits","review_comments_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/pulls/22/comments","review_comment_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/issues/22/comments","statuses_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/statuses/23ca8673495c0193ba76c2e687b4ce2f493e30b2","head":{"label":"fadu-a:develop","ref":"develop","sha":"23ca8673495c0193ba76c2e687b4ce2f493e30b2","user":{"login":"fadu-a","id":38338369,"avatar_url":"https://avatars3.githubusercontent.com/u/38338369?v=4","gravatar_id":"","url":"https://api.github.com/users/fadu-a","html_url":"https://github.com/fadu-a","followers_url":"https://api.github.com/users/fadu-a/followers","following_url":"https://api.github.com/users/fadu-a/following{/other_user}","gists_url":"https://api.github.com/users/fadu-a/gists{/gist_id}","starred_url":"https://api.github.com/users/fadu-a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fadu-a/subscriptions","organizations_url":"https://api.github.com/users/fadu-a/orgs","repos_url":"https://api.github.com/users/fadu-a/repos","events_url":"https://api.github.com/users/fadu-a/events{/privacy}","received_events_url":"https://api.github.com/users/fadu-a/received_events","type":"Organization","site_admin":false},"repo":{"id":129681002,"name":"fadu_test_manager","full_name":"fadu-a/fadu_test_manager","owner":{"login":"fadu-a","id":38338369,"avatar_url":"https://avatars3.githubusercontent.com/u/38338369?v=4","gravatar_id":"","url":"https://api.github.com/users/fadu-a","html_url":"https://github.com/fadu-a","followers_url":"https://api.github.com/users/fadu-a/followers","following_url":"https://api.github.com/users/fadu-a/following{/other_user}","gists_url":"https://api.github.com/users/fadu-a/gists{/gist_id}","starred_url":"https://api.github.com/users/fadu-a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fadu-a/subscriptions","organizations_url":"https://api.github.com/users/fadu-a/orgs","repos_url":"https://api.github.com/users/fadu-a/repos","events_url":"https://api.github.com/users/fadu-a/events{/privacy}","received_events_url":"https://api.github.com/users/fadu-a/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fadu-a/fadu_test_manager","description":null,"fork":false,"url":"https://api.github.com/repos/fadu-a/fadu_test_manager","forks_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/forks","keys_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/teams","hooks_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/hooks","issue_events_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/issues/events{/number}","events_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/events","assignees_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/assignees{/user}","branches_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/branches{/branch}","tags_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/tags","blobs_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/statuses/{sha}","languages_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/languages","stargazers_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/stargazers","contributors_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/contributors","subscribers_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/subscribers","subscription_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/subscription","commits_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/contents/{+path}","compare_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/merges","archive_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/downloads","issues_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/issues{/number}","pulls_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/pulls{/number}","milestones_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/milestones{/number}","notifications_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/labels{/name}","releases_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/releases{/id}","deployments_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/deployments","created_at":"2018-04-16T03:43:56Z","updated_at":"2018-04-16T03:50:10Z","pushed_at":"2018-05-08T01:33:37Z","git_url":"git://github.com/fadu-a/fadu_test_manager.git","ssh_url":"git@github.com:fadu-a/fadu_test_manager.git","clone_url":"https://github.com/fadu-a/fadu_test_manager.git","svn_url":"https://github.com/fadu-a/fadu_test_manager","homepage":null,"size":57,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":6,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"fadu-a:master","ref":"master","sha":"7c108cf4d878cddc88e2ce3b4dfa6b6552c2c467","user":{"login":"fadu-a","id":38338369,"avatar_url":"https://avatars3.githubusercontent.com/u/38338369?v=4","gravatar_id":"","url":"https://api.github.com/users/fadu-a","html_url":"https://github.com/fadu-a","followers_url":"https://api.github.com/users/fadu-a/followers","following_url":"https://api.github.com/users/fadu-a/following{/other_user}","gists_url":"https://api.github.com/users/fadu-a/gists{/gist_id}","starred_url":"https://api.github.com/users/fadu-a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fadu-a/subscriptions","organizations_url":"https://api.github.com/users/fadu-a/orgs","repos_url":"https://api.github.com/users/fadu-a/repos","events_url":"https://api.github.com/users/fadu-a/events{/privacy}","received_events_url":"https://api.github.com/users/fadu-a/received_events","type":"Organization","site_admin":false},"repo":{"id":129681002,"name":"fadu_test_manager","full_name":"fadu-a/fadu_test_manager","owner":{"login":"fadu-a","id":38338369,"avatar_url":"https://avatars3.githubusercontent.com/u/38338369?v=4","gravatar_id":"","url":"https://api.github.com/users/fadu-a","html_url":"https://github.com/fadu-a","followers_url":"https://api.github.com/users/fadu-a/followers","following_url":"https://api.github.com/users/fadu-a/following{/other_user}","gists_url":"https://api.github.com/users/fadu-a/gists{/gist_id}","starred_url":"https://api.github.com/users/fadu-a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fadu-a/subscriptions","organizations_url":"https://api.github.com/users/fadu-a/orgs","repos_url":"https://api.github.com/users/fadu-a/repos","events_url":"https://api.github.com/users/fadu-a/events{/privacy}","received_events_url":"https://api.github.com/users/fadu-a/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fadu-a/fadu_test_manager","description":null,"fork":false,"url":"https://api.github.com/repos/fadu-a/fadu_test_manager","forks_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/forks","keys_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/teams","hooks_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/hooks","issue_events_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/issues/events{/number}","events_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/events","assignees_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/assignees{/user}","branches_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/branches{/branch}","tags_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/tags","blobs_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/statuses/{sha}","languages_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/languages","stargazers_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/stargazers","contributors_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/contributors","subscribers_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/subscribers","subscription_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/subscription","commits_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/contents/{+path}","compare_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/merges","archive_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/downloads","issues_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/issues{/number}","pulls_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/pulls{/number}","milestones_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/milestones{/number}","notifications_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/labels{/name}","releases_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/releases{/id}","deployments_url":"https://api.github.com/repos/fadu-a/fadu_test_manager/deployments","created_at":"2018-04-16T03:43:56Z","updated_at":"2018-04-16T03:50:10Z","pushed_at":"2018-05-08T01:33:37Z","git_url":"git://github.com/fadu-a/fadu_test_manager.git","ssh_url":"git@github.com:fadu-a/fadu_test_manager.git","clone_url":"https://github.com/fadu-a/fadu_test_manager.git","svn_url":"https://github.com/fadu-a/fadu_test_manager","homepage":null,"size":57,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":6,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fadu-a/fadu_test_manager/pulls/22"},"html":{"href":"https://github.com/fadu-a/fadu_test_manager/pull/22"},"issue":{"href":"https://api.github.com/repos/fadu-a/fadu_test_manager/issues/22"},"comments":{"href":"https://api.github.com/repos/fadu-a/fadu_test_manager/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/fadu-a/fadu_test_manager/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/fadu-a/fadu_test_manager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fadu-a/fadu_test_manager/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/fadu-a/fadu_test_manager/statuses/23ca8673495c0193ba76c2e687b4ce2f493e30b2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"houndci-bot"}}