Re: [test-API PATCH] streamAPI: Create stream objects that are already encapsulated

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

 



On 03/22/2012 08:54 PM, Peter Krempa wrote:
With this patch, the newStream() method of the ConnectAPI class returns
an already encapsulated StreamAPI object .
  *lib/connectAPI.py: - modify newStream method to return StreamAPI
                        object
  *lib/streamAPI.py: - modify constructor to take virStream objects
---
  lib/connectAPI.py |    4 +++-
  lib/streamAPI.py  |    9 ++-------
  2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/lib/connectAPI.py b/lib/connectAPI.py
index f52467f..2723fc8 100644
--- a/lib/connectAPI.py
+++ b/lib/connectAPI.py
@@ -24,6 +24,7 @@ import os
  import re

  import libvirt
+from lib import streamAPI

The initial idea is to have a separate file for each of classes(domain, storage, etc) in libvirt.py at least in the form of files. The direction you are heading here is to
     combine them together again.
Testcase is the right place where these objects of encapsulated class should meet
     each other.
I prefer the way of what you did in openConsole API. We just pass the instance of ConnectAPI to initiate SteamAPI class for getting the object of SteamAPI for use
     we should delete the newStream method in connectAPI.py.
Right now, the virConnect object from libvirt.py is exposed directly in existing testcases, that's not good way compared to what you did in openConsole. I will clean them next.
          What do you think?

    Guannan Ren

--
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]