← Back to team overview

sikuli-driver team mailing list archive

[Question #203884]: problem with imports running junit test

 

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

Hello there,

I'm using sikuli on Ubuntu Precise, and I am trying to use modules for common actions and stuff like that.

I have this:

import os.path

ubuntu_actions_path = os.path.join('shared', 'actions', 'ubuntu')
control_panel_actions_path = os.path.join('shared', 'actions', 'controlpanel')
actions_paths = [ubuntu_actions_path, control_panel_actions_path]
for actions_path in actions_paths:
    if not actions_path in sys.path:
        sys.path.append(actions_path)

import unity
import devices

unity.open_ubuntuone_from_launcher_icon()
devices.open_tab()
devices.remove_this_device()

And works flawlessly. (Thanks, btw)

But now I want the script to be a unit test. So I change it to be:

def test_remove_this_device(self):
    unity.open_ubuntuone_from_launcher_icon()
    devices.open_tab()
    devices.remove_this_device()

and I get:
NameError: global name 'unity' is not defined

Am I missing something? Am I doing something stupid?



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