From: Michal 'vorner' Vaner Date: Sat, 30 Jun 2012 17:45:59 +0000 (+0200) Subject: [1976] Add missing test file X-Git-Tag: trac2351_base~97^2~7^2~2^2~21^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=af4e7787d37b951f9a48e992f0e2c6f4e4a28c22;p=thirdparty%2Fkea.git [1976] Add missing test file The file was written previously and not committed to git. Fixing. --- diff --git a/src/bin/cfgmgr/plugins/tests/datasrc_test.py b/src/bin/cfgmgr/plugins/tests/datasrc_test.py new file mode 100644 index 0000000000..6047c442e7 --- /dev/null +++ b/src/bin/cfgmgr/plugins/tests/datasrc_test.py @@ -0,0 +1,36 @@ +# Copyright (C) 2011 Internet Systems Consortium. +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM +# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL +# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING +# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION +# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +# Make sure we can load the module, put it into path +import sys +import os +sys.path.extend(os.environ["B10_TEST_PLUGIN_DIR"].split(':')) + +import datasrc +import unittest + +class DatasrcTest(unittest.TestCase): + def test_load(self): + """ + Checks the entry point returns the correct values. + """ + (spec, check) = datasrc.load() + # It returns the checking function + self.assertEqual(check, datasrc.check) + # The plugin stores it's spec + self.assertEqual(spec, datasrc.spec) + +if __name__ == '__main__': + unittest.main()