From 32a3933b6cbd1bd9e34c2a0fb0abfdd8d6aadee1 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Thu, 14 Jan 2010 23:40:02 +0000 Subject: [PATCH] Add some basic test coverage of factory.py --- terminatorlib/factory.py | 18 +++++++++++++++++- terminatorlib/tests/test_doctests.py | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/terminatorlib/factory.py b/terminatorlib/factory.py index 53ab55d7..24442eeb 100755 --- a/terminatorlib/factory.py +++ b/terminatorlib/factory.py @@ -1,7 +1,23 @@ #!/usr/bin/python # Terminator by Chris Jones # GPL v2 only -"""factory.py - Maker of objects""" +"""factory.py - Maker of objects + +>>> maker = Factory() +>>> window = maker.make_window() +>>> maker.isinstance(window, 'Window') +True +>>> terminal = maker.make_terminal() +>>> maker.isinstance(terminal, 'Terminal') +True +>>> hpaned = maker.make_hpaned() +>>> maker.isinstance(hpaned, 'HPaned') +True +>>> vpaned = maker.make_vpaned() +>>> maker.isinstance(vpaned, 'VPaned') +True + +""" from borg import Borg from util import dbg, err diff --git a/terminatorlib/tests/test_doctests.py b/terminatorlib/tests/test_doctests.py index 2d86b1f5..86898eaa 100644 --- a/terminatorlib/tests/test_doctests.py +++ b/terminatorlib/tests/test_doctests.py @@ -9,6 +9,7 @@ def test_suite(): 'plugin', 'testborg', 'cwd', + 'factory', ): suite.addTest(DocTestSuite('terminatorlib.' + name)) return suite