← Back to team overview

sikuli-driver team mailing list archive

[Question #189457]: Importing my library but not run [Unit Test Mode]

 

New question #189457 on Sikuli:
https://answers.launchpad.net/sikuli/+question/189457

I am having issues with importing other Sikuli scripts that I made so I can reuse code.

I am trying to import my library and use them in the Unit Test mode.

I have followed Question #146640 (https://answers.launchpad.net/sikuli/+question/146640)
and also the documentations on importing other Sikuli Scripts from the Sikuli site. (http://sikuli.org/docx/globals.html#importing-other-sikuli-scripts-reuse-code-and-images)

But some reason it does seem to work for me.

I am running Sikuli X-1.0rc3 (r905)
Windows Environment


Example of how my code looks out BUT not the exact code.

My Library File Located in C:\Lib

MyLib.Sikuli
--------------
from sikuli import *

def PrintMe():
    print "I worked"


SampleUnitTest.Sikuli
---------------
def setUp(self):
    Libs = "C:\\Lib"
    if not Libs in sys.path: sys.path.append(Libs)
    import MyLib

def tearDown(self):
    sleep(1)

def test_ATest(self):
    print "Before"
    Libs.PrintMe()
    print "After”


When I run the Unit Test, I see "Before" printed out but NOT "I worked" or "After".
I have also tested "self.Libs.PrintMe()" but did not help at all.

Also for my future reference...
IF my question is considered to be related to another ticket that is labeled solved/closed like the ticket that I referenced at top for this question... Should I post in that thread even if its been solved/closed? AND if that post was very old, will my post get recognized??? or should I make a new post like I did just now???

Thanks


-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.