summaryrefslogtreecommitdiff
path: root/tests/schema/panels/test_graph.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/schema/panels/test_graph.py')
-rw-r--r--tests/schema/panels/test_graph.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/schema/panels/test_graph.py b/tests/schema/panels/test_graph.py
new file mode 100644
index 0000000..a54e11f
--- /dev/null
+++ b/tests/schema/panels/test_graph.py
@@ -0,0 +1,47 @@
1# Copyright 2015 Red Hat, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15from testtools import TestCase
16
17from grafana_dashboards.schema.panel.graph import Graph
18
19
20class TestCaseGraph(TestCase):
21
22 def setUp(self):
23 super(TestCaseGraph, self).setUp()
24 self.schema = Graph().get_schema()
25
26 def test_defaults(self):
27 # Ensure default values get parsed correctly.
28 defaults = {
29 'bars': False,
30 'editable': True,
31 'error': False,
32 'fill': 1,
33 'lines': True,
34 'linewidth': 2,
35 'percentage': False,
36 'pointradius': 5,
37 'points': False,
38 'span': 12,
39 'stack': False,
40 'steppedLine': False,
41 'targets': [],
42 'title': 'foobar',
43 'type': 'graph',
44 'x-axis': True,
45 'y-axis': True,
46 }
47 self.assertEqual(self.schema(defaults), defaults)