summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authormakkalot <makkalot@gmail.com>2008-05-31 01:13:33 +0300
committermakkalot <makkalot@gmail.com>2008-05-31 01:13:33 +0300
commit15fc492fdb83a1176c658d4ca1277b1d556be787 (patch)
tree4cc62ec8b0c090fd8cfa01b46d4e43be7630d6b4 /test
parent4357afa7740a407f035e824cfd3bea61a06cefa7 (diff)
downloadthird_party-func-15fc492fdb83a1176c658d4ca1277b1d556be787.tar.gz
third_party-func-15fc492fdb83a1176c658d4ca1277b1d556be787.tar.xz
third_party-func-15fc492fdb83a1176c658d4ca1277b1d556be787.zip
teh unittest for that module
Diffstat (limited to 'test')
-rw-r--r--test/unittest/test_func_arg.py65
1 files changed, 65 insertions, 0 deletions
diff --git a/test/unittest/test_func_arg.py b/test/unittest/test_func_arg.py
new file mode 100644
index 0000000..adee9f0
--- /dev/null
+++ b/test/unittest/test_func_arg.py
@@ -0,0 +1,65 @@
+##
+## Copyright 2007, Red Hat, Inc
+## see AUTHORS
+##
+## This software may be freely redistributed under the terms of the GNU
+## general public license.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+##
+
+#tester module for ArgCompatibility
+from func.minion.modules.func_arg import ArgCompatibility
+
+class ArgCompatibilityTest:
+
+ def setUp(self):
+ #create the simple object
+ ac = ArgCompatibility(self.dummy_arg_getter())
+ print self.dummy_arg_getter()
+
+ def dummy_arg_getter(self):
+ """
+ A simple method to test the stuff we have written for
+ arg compatiblity. I just return a dict with proper stuff
+ """
+ return {
+ 'hifunc':{
+
+ 'app':{
+ 'type':'int',
+ 'range':(0,100),
+ 'optional':False,
+ 'default' : 12
+ },
+
+ 'platform':{
+ 'type':'string',
+ 'min_length':50,
+ 'max_length':100,
+ 'options':('fedora8','fedora9','some_other'),'description':"Hey im a fedora fan"
+ },
+
+ 'is_independent':{
+ 'type':'boolean',
+ 'default' :False,
+ 'description':'Are you independent ?'
+ },
+
+ 'some_string':{
+ 'type':'string',
+ 'validato': "^[a-zA-Z]$",} # validator is a re string for those whoo need better validation...
+
+ }
+ }
+
+ def test_arg_compatibility(self):
+ """
+ Simple test
+ """
+ result = self.ac.validate_all()
+ #self.assert_on_fault(result)
+ assert result == False
+