Skip to content

Commit

Permalink
avoid using active_view instead use new_file
Browse files Browse the repository at this point in the history
  • Loading branch information
predragnikolic committed Mar 21, 2024
1 parent 0494cdc commit bb775fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_no_configs(self):

def test_with_single_config(self):
window = sublime.active_window()
view = window.active_view()
view = window.new_file()
self.assertIsNotNone(view)
assert view
manager = WindowConfigManager(window, {TEST_CONFIG.name: TEST_CONFIG})
Expand All @@ -45,12 +45,12 @@ def test_with_single_config(self):
scope="text.plain",
hidden=False
))
# view.settings().set("lsp_uri", "file:///foo/bar.txt")
view.settings().set("lsp_uri", "file:///foo/bar.txt")
self.assertEqual(list(manager.match_view(view)), [TEST_CONFIG])

def test_applies_project_settings(self):
window = sublime.active_window()
view = window.active_view()
view = window.new_file()
assert view
window.project_data = MagicMock(return_value={
"settings": {
Expand All @@ -68,7 +68,7 @@ def test_applies_project_settings(self):
scope="text.plain",
hidden=False
))
# view.settings().set("lsp_uri", "file:///foo/bar.txt")
view.settings().set("lsp_uri", "file:///foo/bar.txt")
configs = list(manager.match_view(view))
self.assertEqual(len(configs), 1)
config = configs[0]
Expand Down

0 comments on commit bb775fe

Please sign in to comment.