Skip to content

Conversation

@jana-selva
Copy link
Contributor

No description provided.

Copy link
Contributor

@tomuben tomuben Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please adapt to new behavior (using the scs location file, instead of the line magic).

Overwrite or mock get_scs_location_file_path() and then check if the file path was saved correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please review, i changed the logic to read from file

@jana-selva jana-selva deployed to manual-approval December 22, 2025 05:41 — with GitHub Actions Active
@jana-selva jana-selva deployed to text-ai-prerelease December 22, 2025 05:45 — with GitHub Actions Active
@sonarqubecloud
Copy link

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this file can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think I should remove access_store_ui_app.py as well , because unused

Comment on lines 13 to 15
monkeypatch.setattr(access_ui, "get_scs_location_file_path", lambda: test_scs_file)

def test_access_store_ui_store_read_and_write(tmp_path):
mock_ipython = MagicMock()
with patch(
"exasol.nb_connector.ui.access_store_ui.get_ipython", return_value=mock_ipython
):
# call UI
ui = get_access_store_ui(str(tmp_path))
# assert "store -r" is called
mock_ipython.run_line_magic.assert_any_call("store", "-r")
# find open button
open_btn = next(
child
for child in ui.children
if isinstance(child, ipywidgets.Button) and child.description == "Open"
)
# click open button
mock_ipython.run_line_magic.reset_mock()
open_btn.click()
# assert "store" is called
mock_ipython.run_line_magic.assert_any_call("store", "sb_store_file")
test_scs_file = tmp_path / "scs_file"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switch order: Define first test_scs_file, then patch get_scs_location_file_path.

Makes readability of the code much easier....

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe even define a fixture for test_scs_file



@pytest.fixture
def test_scs_file(tmp_path):
    test_scs_file = tmp_path / "scs_file"
    if test_scs_file.exists():
        test_scs_file.unlink()
    yield test_scs_file
    test_scs_file.unlink()

def test_access_store_ui_store_read_and_write_2(tmp_path, test_scs_file, monkeypatch):
...

@@ -0,0 +1,15 @@
"""
Copy link
Contributor Author

@jana-selva jana-selva Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we remove this file ?
ain't we ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants