Skip to content

Commit 9f630fa

Browse files
committed
test: add test for vscode cursor
chore: update test workflow to include vscode cursor test
1 parent da6c562 commit 9f630fa

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ jobs:
144144
- 'tests/test_serial.py::test_install_clean[default]'
145145
- 'tests/test_serial.py::test_install_clean[on-request]'
146146
- 'tests/test_serial.py::test_install_clean[top-packages]'
147+
- 'tests/test_serial.py::test_vscode_cursor'
147148
runs-on: macos-latest
148149
steps:
149150
- uses: rcmdnk/python-action@v3

tests/test_serial.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,3 +556,66 @@ def test_install_clean(
556556
assert lines == ls2
557557
_, lines = helper.proc('brew tap')
558558
assert lines == tap2
559+
560+
561+
def test_vscode_cursor(
562+
cmd: str,
563+
brewfile: str,
564+
helper: BrewHelper,
565+
monkeypatch: pytest.MonkeyPatch,
566+
) -> None:
567+
monkeypatch.setenv('HOMEBREW_BREWFILE_VSCODE', '1')
568+
monkeypatch.setenv('HOMEBREW_BREWFILE_CURSOR', '1')
569+
with Path(brewfile).open('w') as f:
570+
f.write("""
571+
code ms-python.python
572+
cursor ms-vscode.remote-explorer
573+
""")
574+
helper.proc(f'"{cmd}" install -f "{brewfile}"')
575+
helper.proc(f'"{cmd}" init -f "{brewfile}" -y')
576+
with Path(brewfile).open('r') as f:
577+
assert (
578+
f.read()
579+
== """
580+
# tap repositories and their packages
581+
582+
tap homebrew/core
583+
584+
tap homebrew/cask
585+
cask cursor
586+
cask visual-studio-code
587+
588+
# VSCode extensions
589+
vscode ms-python.debugpy
590+
vscode ms-python.python
591+
vscode ms-python.vscode-pylance
592+
593+
# Cursor extensions
594+
cursor ms-vscode.remote-explorer
595+
"""
596+
)
597+
598+
with Path(brewfile).open('w') as f:
599+
f.write("""
600+
tap homebrew/core
601+
tap homebrew/cask
602+
cask visual-studio-code
603+
vscode ms-python.vscode-pylance
604+
""")
605+
helper.proc(f'"{cmd}" cleanup -f "{brewfile}"')
606+
helper.proc(f'"{cmd}" init -f "{brewfile}" -y')
607+
with Path(brewfile).open('r') as f:
608+
assert (
609+
f.read()
610+
== """
611+
# tap repositories and their packages
612+
613+
tap homebrew/core
614+
615+
tap homebrew/cask
616+
cask visual-studio-code
617+
618+
# VSCode extensions
619+
vscode ms-python.vscode-pylance
620+
"""
621+
)

0 commit comments

Comments
 (0)