summaryrefslogtreecommitdiff
path: root/tests/schema/panels/test_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/schema/panels/test_base.py')
-rw-r--r--tests/schema/panels/test_base.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/schema/panels/test_base.py b/tests/schema/panels/test_base.py
new file mode 100644
index 0000000..420fab6
--- /dev/null
+++ b/tests/schema/panels/test_base.py
@@ -0,0 +1,35 @@
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.base import Base
18
19
20class TestCaseBase(TestCase):
21
22 def setUp(self):
23 super(TestCaseBase, self).setUp()
24 self.schema = Base().get_schema()
25
26 def test_defaults(self):
27 # Ensure default values get parsed correctly.
28 defaults = {
29 'editable': True,
30 'error': False,
31 'span': 12,
32 'title': 'foobar',
33 'type': 'text',
34 }
35 self.assertEqual(self.schema(defaults), defaults)