Skip to content

Commit 5abcfe8

Browse files
committed
apparently do imports properly
1 parent c29a72b commit 5abcfe8

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
__pycache__/
22
_artifacts/
3+
.ipynb_checkpoints/
34
*.egg-info
45
build/
56
envs/
67
lib/
8+
Untitled*.*

atest/acceptance/10_lab/00_shell.robot

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Suite Setup Wait for New Jupyter Server to be Ready
33
Test Teardown Close All Browsers
44
Library JupyterLibrary
55
Library Process
6-
Resource JupyterLibrary/resources/jupyterlab/Shell.robot
76

87
*** Test Cases ***
98
Open JupyterLab

src/JupyterLibrary/core.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
from glob import glob
22
from os.path import basename, dirname, join
33

4+
from robot.api import ResourceFile
45
from robot.libraries.BuiltIn import BuiltIn
6+
from robot.utils import find_file
57
from SeleniumLibrary import SeleniumLibrary
8+
from SeleniumLibrary.utils.librarylistener import LibraryListener
69

710
from .keywords import server
811

@@ -38,6 +41,17 @@ def __init__(
3841
screenshot_root_directory=None,
3942
)
4043
self.add_library_components([server.ServerKeywords(self)])
44+
self.ROBOT_LIBRARY_LISTENER = JupyterLibraryListener()
45+
46+
47+
class JupyterLibraryListener(LibraryListener):
48+
""" Custom listener to do per-suite imports of resource files
49+
"""
50+
51+
ROBOT_LISTENER_API_VERSION = 2
52+
53+
def start_suite(self, name, attrs):
54+
super(JupyterLibraryListener, self).start_suite(name, attrs)
4155
for path in glob(join(RESOURCES, "jupyterlab", "*.robot")):
42-
resource = "JupyterLibrary/resources/jupyterlab/" + basename(path)
56+
resource = "JupyterLibrary/resources/jupyterlab/{}".format(basename(path))
4357
BuiltIn().import_resource(resource)

0 commit comments

Comments
 (0)