Re: [PATCH python] Improve quality of sanitytest check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 27, 2013 at 10:28:08AM -0500, Doug Goldstein wrote:
> > 
> > On Nov 27, 2013, at 6:19 AM, "Daniel P. Berrange" <berrange@xxxxxxxxxx> wrote:
> > 
> >> On Tue, Nov 26, 2013 at 01:16:24PM -0600, Doug Goldstein wrote:
> >> On Tue, Nov 26, 2013 at 12:32 PM, Daniel P. Berrange
> >> <berrange@xxxxxxxxxx> wrote:
> >>> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> >>> 
> >>> Validate that every public API method is mapped into the python
> >>> and that every python method has a sane C API.
> >> 
> >> Looks like we had the same idea and even a similar approach as well.
> >> 
> >>> 
> >>> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> >>> ---
> >>> sanitytest.py | 309 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
> >>> setup.py      |  35 +++----
> >>> 2 files changed, 294 insertions(+), 50 deletions(-)
> >>> mode change 100755 => 100644 sanitytest.py
> >>> 
> >>> diff --git a/sanitytest.py b/sanitytest.py
> >>> old mode 100755
> >>> new mode 100644
> >>> index 517054b..9e4c261
> >>> --- a/sanitytest.py
> >>> +++ b/sanitytest.py
> >>> @@ -1,40 +1,283 @@
> >>> #!/usr/bin/python
> >>> 
> >>> import sys
> >>> +import lxml
> >>> +import lxml.etree
> 
> Can we drop the explicit lxml import since we are only using
> etree? Then we can try lxml.etree and xml.etree as fallbacks.
> Do we need lxml added to the spec file for building as well?

The 'xpath' function is lxml only - the regular etree module
only has 'find' which doesn't do proper xpath queries.

> >>> +# Phase 1: Identify all functions and enums in public API
> >>> +set = tree.xpath('/api/files/file/exports[@type="function"]/@symbol')
> >>> +for n in set:
> >>> +    wantfunctions.append(n)
> >>> +
> >>> +set = tree.xpath('/api/files/file/exports[@type="enum"]/@symbol')
> >>> +for n in set:
> >>> +    wantenums.append(n)
> >>> +

Daniel.
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]