From 3cf6b38bfcfef04d6c537df79be2d8d90a5fc80b Mon Sep 17 00:00:00 2001 From: makkalot Date: Sun, 15 Jun 2008 16:50:54 +0300 Subject: adding tests for is_all_arguments_registered part --- test/unittest/test_func_arg.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/unittest/test_func_arg.py b/test/unittest/test_func_arg.py index 1b9102c..8f0c967 100644 --- a/test/unittest/test_func_arg.py +++ b/test/unittest/test_func_arg.py @@ -33,7 +33,14 @@ class TestArgCompatibility: self.ac = ArgCompatibility(self.dummy_empty_args()) result = self.ac.validate_all() assert result == True - + + def test_is_all_arguments_registered(self): + #create the dummy class + tc = FooClass() + arguments = tc.register_method() + assert self.ac.is_all_arguments_registered(tc,'foomethod',arguments['foomethod']['args'])==True + print arguments + def dummy_no_getter(self): return {} @@ -112,5 +119,25 @@ class TestArgCompatibility: } +class FooClass(object): + """ + Sample class for testing the is_all_arguments_registered + method functionality ... + """ + + def foomethod(self,arg1,arg5,arg4,*arg,**kw): + pass + def register_method(self): + return{ + 'foomethod':{ + 'args':{ + 'arg1':{}, + 'arg4':{}, + 'arg5':{}, + 'arg':{}, + 'kw':{}, + } + } + } -- cgit