]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1976] Add missing test file
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Sat, 30 Jun 2012 17:45:59 +0000 (19:45 +0200)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Sat, 30 Jun 2012 17:45:59 +0000 (19:45 +0200)
The file was written previously and not committed to git. Fixing.

src/bin/cfgmgr/plugins/tests/datasrc_test.py [new file with mode: 0644]

diff --git a/src/bin/cfgmgr/plugins/tests/datasrc_test.py b/src/bin/cfgmgr/plugins/tests/datasrc_test.py
new file mode 100644 (file)
index 0000000..6047c44
--- /dev/null
@@ -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()