Skip to content

Commit 6b21dff

Browse files
review: add edge case tests for Quarto Shiny detection
Add test cases for scenarios where the server field exists but has incorrect values (not "shiny"). This improves test coverage and makes the behavior more explicit for edge cases. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 2ef3b27 commit 6b21dff

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

tests/test_actions.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,36 @@ def test_is_quarto_shiny_empty_inspect(self):
6161
}
6262
self.assertFalse(is_quarto_shiny(inspect))
6363

64+
def test_is_quarto_shiny_wrong_server_type(self):
65+
"""Test that documents with wrong server type are not detected as Shiny"""
66+
inspect = {
67+
"quarto": {"version": "1.3.0"},
68+
"engines": ["jupyter"],
69+
"formats": {
70+
"html": {
71+
"metadata": {
72+
"server": {"type": "other"},
73+
},
74+
},
75+
},
76+
}
77+
self.assertFalse(is_quarto_shiny(inspect))
78+
79+
def test_is_quarto_shiny_wrong_server_value(self):
80+
"""Test that documents with wrong server value in fileInformation are not detected as Shiny"""
81+
inspect = {
82+
"quarto": {"version": "1.3.0"},
83+
"engines": ["jupyter"],
84+
"fileInformation": {
85+
"/path/to/app.qmd": {
86+
"metadata": {
87+
"server": "other",
88+
},
89+
},
90+
},
91+
}
92+
self.assertFalse(is_quarto_shiny(inspect))
93+
6494
def test_infer_quarto_app_mode_shiny(self):
6595
"""Test that Shiny documents get SHINY_QUARTO mode"""
6696
inspect = {

0 commit comments

Comments
 (0)