From: Tennis Smith
To: Dave Kuhlman
Sent: Sunday, July 5, 2009 2:01:27 PM
Subject: Any way to ... ?

> Hi,
> 
> Is there any way I can figure out if every object type has been
> instantiated at least once?  I'm trying to make sure I test
> everything defined in a schema.
> 
> Thoughts?

Tennis -

There is no direct support for this.  Hmmm.  Maybe we should
consider adding something that would help with coverage.

You might try something like the following to get a list of classes:

    $ grep "^class " file1.py file2.py | grep -Ev 
"(MixedContainer)|(_MemberSpec)"

Would it help to have a script that generated a dictionary of class
names and classes?  For example:

    ClassDictionary = {
        'Class_1': Class_1,
        'Class_2': Class_2,
        o
        o
        o
        }

Then, in Python, you could do something like the following:

    instances = []
    for name, class_ in ClassDictionary:
        instance = class_()
        instances.append(instance)
    return instances

If that would help, I'll look into it.

But, I don't know of any way to find out which classes have not already
been instantiated by your code.

- Dave


 -- 

Dave Kuhlman
http://www.rexx.com/~dkuhlman

------------------------------------------------------------------------------
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to