-
Notifications
You must be signed in to change notification settings - Fork 159
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
63d053d
commit a904535
Showing
9 changed files
with
259 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
recursive-include dashboard/static * | ||
recursive-include dashboard/templates * | ||
recursive-include flask_monitoringdashboard/static * | ||
recursive-include flask_monitoringdashboard/templates * |
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
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,20 @@ | ||
import unittest | ||
|
||
from flask_monitoringdashboard.test.utils import set_test_environment, clear_db, add_fake_data, login, get_test_app | ||
|
||
|
||
class TestLogin(unittest.TestCase): | ||
|
||
def setUp(self): | ||
set_test_environment() | ||
clear_db() | ||
add_fake_data() | ||
self.app = get_test_app() | ||
|
||
def test_login(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(200, self.app.get('dashboard/login').status_code) | ||
login(self.app) | ||
self.assertEqual(302, self.app.get('dashboard/login').status_code) |
53 changes: 53 additions & 0 deletions
53
flask_monitoringdashboard/test/routings/test_measurements.py
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,53 @@ | ||
import unittest | ||
|
||
from flask_monitoringdashboard.test.utils import set_test_environment, clear_db, add_fake_data, get_test_app, login | ||
|
||
|
||
class TestMeasurement(unittest.TestCase): | ||
|
||
def setUp(self): | ||
set_test_environment() | ||
clear_db() | ||
add_fake_data() | ||
self.app = get_test_app() | ||
|
||
def test_overview(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(302, self.app.get('dashboard/measurements/overview').status_code) | ||
login(self.app) | ||
self.assertEqual(200, self.app.get('dashboard/measurements/overview').status_code) | ||
|
||
def test_heatmap(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(302, self.app.get('dashboard/measurements/heatmap').status_code) | ||
login(self.app) | ||
self.assertEqual(200, self.app.get('dashboard/measurements/heatmap').status_code) | ||
|
||
def test_page_number_of_requests_per_endpoint(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(302, self.app.get('dashboard/measurements/requests').status_code) | ||
login(self.app) | ||
self.assertEqual(200, self.app.get('dashboard/measurements/requests').status_code) | ||
|
||
def test_page_boxplot_per_version(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(302, self.app.get('dashboard/measurements/versions').status_code) | ||
login(self.app) | ||
self.assertEqual(200, self.app.get('dashboard/measurements/versions').status_code) | ||
|
||
def test_page_boxplot_per_endpoint(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(302, self.app.get('dashboard/measurements/endpoints').status_code) | ||
login(self.app) | ||
self.assertEqual(200, self.app.get('dashboard/measurements/endpoints').status_code) | ||
|
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,77 @@ | ||
import unittest | ||
|
||
from flask_monitoringdashboard.test.utils import set_test_environment, clear_db, add_fake_data, get_test_app, login, \ | ||
NAME | ||
|
||
|
||
class TestResult(unittest.TestCase): | ||
|
||
def setUp(self): | ||
set_test_environment() | ||
clear_db() | ||
add_fake_data() | ||
self.app = get_test_app() | ||
|
||
def test_result_heatmap(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(302, self.app.get('dashboard/result/{}/heatmap'.format(NAME)).status_code) | ||
login(self.app) | ||
self.assertEqual(200, self.app.get('dashboard/result/{}/heatmap'.format(NAME)).status_code) | ||
|
||
def test_result_time_per_hour(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(302, self.app.get('dashboard/result/{}/time_per_hour'.format(NAME)).status_code) | ||
login(self.app) | ||
self.assertEqual(200, self.app.get('dashboard/result/{}/time_per_hour'.format(NAME)).status_code) | ||
|
||
def test_result_hits_per_hour(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(302, self.app.get('dashboard/result/{}/hits_per_hour'.format(NAME)).status_code) | ||
login(self.app) | ||
self.assertEqual(200, self.app.get('dashboard/result/{}/hits_per_hour'.format(NAME)).status_code) | ||
|
||
def test_result_time_per_version_per_user(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(302, self.app.get('dashboard/result/{}/time_per_version_per_user'.format(NAME)).status_code) | ||
login(self.app) | ||
self.assertEqual(200, self.app.get('dashboard/result/{}/time_per_version_per_user'.format(NAME)).status_code) | ||
|
||
def test_result_time_per_version_per_ip(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(302, self.app.get('dashboard/result/{}/time_per_version_per_ip'.format(NAME)).status_code) | ||
login(self.app) | ||
self.assertEqual(200, self.app.get('dashboard/result/{}/time_per_version_per_ip'.format(NAME)).status_code) | ||
|
||
def test_result_time_per_version(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(302, self.app.get('dashboard/result/{}/time_per_version'.format(NAME)).status_code) | ||
login(self.app) | ||
self.assertEqual(200, self.app.get('dashboard/result/{}/time_per_version'.format(NAME)).status_code) | ||
|
||
def test_result_time_per_user(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(302, self.app.get('dashboard/result/{}/time_per_user'.format(NAME)).status_code) | ||
login(self.app) | ||
self.assertEqual(200, self.app.get('dashboard/result/{}/time_per_user'.format(NAME)).status_code) | ||
|
||
def test_result_outliers(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(302, self.app.get('dashboard/result/{}/outliers'.format(NAME)).status_code) | ||
login(self.app) | ||
self.assertEqual(200, self.app.get('dashboard/result/{}/outliers'.format(NAME)).status_code) |
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,45 @@ | ||
import unittest | ||
|
||
from flask_monitoringdashboard.test.utils import set_test_environment, clear_db, add_fake_data, get_test_app, login, \ | ||
NAME | ||
|
||
|
||
class TestSetup(unittest.TestCase): | ||
|
||
def setUp(self): | ||
set_test_environment() | ||
clear_db() | ||
add_fake_data() | ||
self.app = get_test_app() | ||
|
||
def test_settings(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(302, self.app.get('dashboard/settings').status_code) | ||
login(self.app) | ||
self.assertEqual(200, self.app.get('dashboard/settings').status_code) | ||
|
||
def test_rules(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(302, self.app.get('dashboard/rules').status_code) | ||
login(self.app) | ||
self.assertEqual(200, self.app.get('dashboard/rules').status_code) | ||
|
||
def test_test_result(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(302, self.app.get('dashboard/testmonitor/{}'.format(NAME)).status_code) | ||
login(self.app) | ||
self.assertEqual(200, self.app.get('dashboard/testmonitor/{}'.format(NAME)).status_code) | ||
|
||
def test_testmonitor(self): | ||
""" | ||
Just retrieve the content and check if nothing breaks | ||
""" | ||
self.assertEqual(302, self.app.get('dashboard/testmonitor').status_code) | ||
login(self.app) | ||
self.assertEqual(200, self.app.get('dashboard/testmonitor').status_code) |
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