diff options
author | makkalot <makkalot@gmail.com> | 2008-06-08 15:11:10 +0300 |
---|---|---|
committer | makkalot <makkalot@gmail.com> | 2008-06-08 15:11:10 +0300 |
commit | 218579808049d8739f2be29b88a96a515034b8d5 (patch) | |
tree | db8a3d8c8f4c037d91dbf5e88b8fe18e61fb3b87 /test/unittest | |
parent | 18a872de604eaeefff7603fd889a8f7baf8fc94e (diff) | |
download | func-218579808049d8739f2be29b88a96a515034b8d5.tar.gz func-218579808049d8739f2be29b88a96a515034b8d5.tar.xz func-218579808049d8739f2be29b88a96a515034b8d5.zip |
changing get_method_args tests
Diffstat (limited to 'test/unittest')
-rw-r--r-- | test/unittest/test_func_arg.py | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/test/unittest/test_func_arg.py b/test/unittest/test_func_arg.py index bb7a5e2..35f09c9 100644 --- a/test/unittest/test_func_arg.py +++ b/test/unittest/test_func_arg.py @@ -25,6 +25,25 @@ class TestArgCompatibility: """ result = self.ac.validate_all() assert result == True + + self.ac = ArgCompatibility(self.dummy_no_getter()) + result = self.ac.validate_all() + assert result == True + + self.ac = ArgCompatibility(self.dummy_empty_args()) + result = self.ac.validate_all() + assert result == True + + def dummy_no_getter(self): + return {} + + def dummy_empty_args(self): + return{ + 'myfunc':{ + 'args':{}, + 'description':'Cool methods here' + } + } def dummy_arg_getter(self): """ @@ -34,19 +53,21 @@ class TestArgCompatibility: """ return { 'hifunc':{ - + + 'args':{ 'app':{ 'type':'int', - 'range':(0,100), + 'range':[0,100], 'optional':False, 'default' : 12 }, 'platform':{ 'type':'string', - 'min_length':5, - 'max_length':100, - 'options':('fedora8','fedora9','some_other'),'description':"Hey im a fedora fan", + 'min_length':4, + 'max_length':33, + 'options':["fedora","redhat","ubuntu"], + 'description':"Hey im a fedora fan", 'default':'fedora8', }, @@ -80,12 +101,16 @@ class TestArgCompatibility: 'some_hash':{ 'type':'hash', - 'description':'The value and description for **kwarg', + 'description':"Dummy desc here", 'optional':True, #of course it is, - 'validator':'^[a-z]*$',#only for values not keys + 'validator':"^[a-z]*$",#only for values not keys } + }, + 'description':"The dummy method description", } } + + |