This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28c5aec
commit 89d226e
Showing
5 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block sidebar %} | ||
{% include "sidebar.html" with active="healing" %} | ||
{% endblock %} | ||
|
||
{% block header %} | ||
<h1>Admin/Healing</h1> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="container-fluid"> | ||
<div class="row-fluid"> | ||
<div class="span11"> | ||
<table class="table"> | ||
<tr> | ||
<th>Start</th> | ||
<th>Finish</th> | ||
<th>Success</th> | ||
<th>Failing</th> | ||
<th>Created</th> | ||
<th>Error</th> | ||
</tr> | ||
{% for event in events %} | ||
<tr> | ||
<td>{{ event.StartTime }}</td> | ||
<td>{{ event.EndTime }}</td> | ||
<td>{{ event.Succefull }}</td> | ||
<td>{% if event.FailingNode.Address %}{{ event.FailingNode.Address }}{% else %}{{ event.FailingContainer.ID }}{% endif %}</td> | ||
<td>{% if event.CreatedNode.Address %}{{ event.CreatedNode.Address }}{% else %}{{ event.CreatedContainer.ID }}{% endif %}</td> | ||
<td>{{ event.Error }}</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from mock import patch, Mock | ||
|
||
from django.conf import settings | ||
from django.test import TestCase | ||
from django.test.client import RequestFactory | ||
|
||
from admin.views import ListHealing | ||
|
||
|
||
class ListHealingViewTest(TestCase): | ||
def setUp(self): | ||
self.request = RequestFactory().get("/") | ||
self.request.session = {"tsuru_token": "admin"} | ||
|
||
@patch("requests.get") | ||
def test_should_use_list_template(self, get): | ||
response_mock = Mock() | ||
response_mock.json.return_value = [] | ||
get.return_value = response_mock | ||
response = ListHealing.as_view()(self.request) | ||
self.assertEqual("docker/list_healing.html", response.template_name) | ||
expected = [] | ||
self.assertListEqual(expected, response.context_data["events"]) | ||
get.assert_called_with( | ||
"{0}/docker/healing".format(settings.TSURU_HOST), | ||
headers={"authorization": "admin"} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters