From e63785028eb0fb676ca06ce44a188877e5621e1f Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 23 Sep 2008 00:13:48 +0100 Subject: [PATCH] initial skeletal test framework using nosetest --- terminatorlib/tests.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 terminatorlib/tests.py diff --git a/terminatorlib/tests.py b/terminatorlib/tests.py new file mode 100644 index 00000000..cbeadfef --- /dev/null +++ b/terminatorlib/tests.py @@ -0,0 +1,39 @@ +#!/usr/bin/python +"""Terminator test suite. This uses the nosetest testing framework. See http://somethingaboutorange.com/mrl/projects/nose/""" + +def test_version(): + import version + + assert version.APP_NAME == 'terminator' + +class test_encodings(): + encoding = None + + def setup (self): + import gettext + gettext.install ('test') + import encoding + self.encoding = encoding.TerminatorEncoding + + def test_length (self): + assert len (self.encoding.encodings) == 74 + + def test_get_list (self): + assert self.encoding.get_list () == self.encoding.encodings + +class test_config(): + config = None + + def setup (self): + import config + self.config = config + + def test_defaults_lengths (self): + assert len(self.config.Defaults) > 1 + assert len(self.config.Defaults['keybindings']) > 1 + + def test_TerminatorConfValuestore (self): + store = self.config.TerminatorConfValuestore () + assert store.type == "Base" + store.values['test_key'] = 'test_value' + assert store['test_key'] == 'test_value'