-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit ... 1. adds `DeferrabbleViewTestCase` class 2. extends `ViewTestCase` class 3. bases various existing unit self tests on them
- Loading branch information
Showing
9 changed files
with
92 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,9 @@ | ||
import sublime | ||
from unittest import TestCase | ||
from unittesting import ViewTestCase | ||
|
||
|
||
class TestHelloWorld(TestCase): | ||
|
||
def setUp(self): | ||
self.view = sublime.active_window().new_file() | ||
# make sure we have a window to work with | ||
s = sublime.load_settings("Preferences.sublime-settings") | ||
s.set("close_windows_when_empty", False) | ||
|
||
def tearDown(self): | ||
if self.view: | ||
self.view.set_scratch(True) | ||
self.view.window().focus_view(self.view) | ||
self.view.window().run_command("close_file") | ||
class TestHelloWorld(ViewTestCase): | ||
|
||
def test_hello_world(self): | ||
self.view.run_command("insert", {"characters": "hello world"}) | ||
first_row = self.view.substr(self.view.line(0)) | ||
self.setText("hello world") | ||
first_row = self.getRowText(0) | ||
self.assertEqual(first_row, "hello world!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,9 @@ | ||
import sublime | ||
from unittest import TestCase | ||
from unittesting import ViewTestCase | ||
|
||
|
||
class TestHelloWorld(TestCase): | ||
|
||
def setUp(self): | ||
self.view = sublime.active_window().new_file() | ||
# make sure we have a window to work with | ||
s = sublime.load_settings("Preferences.sublime-settings") | ||
s.set("close_windows_when_empty", False) | ||
|
||
def tearDown(self): | ||
if self.view: | ||
self.view.set_scratch(True) | ||
self.view.window().focus_view(self.view) | ||
self.view.window().run_command("close_file") | ||
class TestHelloWorld(ViewTestCase): | ||
|
||
def test_hello_world(self): | ||
self.view.run_command("insert", {"characters": "hello world"}) | ||
first_row = self.view.substr(self.view.line(0)) | ||
self.setText("hello world") | ||
first_row = self.getRowText(0) | ||
self.assertEqual(first_row, "hello world") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,9 @@ | ||
import sublime | ||
from unittest import TestCase | ||
from unittesting import ViewTestCase | ||
|
||
|
||
class TestHelloWorld(TestCase): | ||
|
||
def setUp(self): | ||
self.view = sublime.active_window().new_file() | ||
# make sure we have a window to work with | ||
s = sublime.load_settings("Preferences.sublime-settings") | ||
s.set("close_windows_when_empty", False) | ||
|
||
def tearDown(self): | ||
if self.view: | ||
self.view.set_scratch(True) | ||
self.view.window().focus_view(self.view) | ||
self.view.window().run_command("close_file") | ||
class TestHelloWorld(ViewTestCase): | ||
|
||
def test_hello_world(self): | ||
self.view.run_command("insert", {"characters": "hello world"}) | ||
first_row = self.view.substr(self.view.line(0)) | ||
self.setText("hello world") | ||
first_row = self.getRowText(0) | ||
self.assertEqual(first_row, "hello world") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from .override_preferences_test_cast import OverridePreferencesTestCase # noqa: F401 | ||
from .temp_directory_test_case import TempDirectoryTestCase # noqa: F401 | ||
from .view_test_case import ViewTestCase # noqa: F401 | ||
# noqa: F401 | ||
from .override_preferences_test_cast import OverridePreferencesTestCase | ||
from .temp_directory_test_case import TempDirectoryTestCase | ||
from .view_test_case import DeferrableViewTestCase | ||
from .view_test_case import ViewTestCase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters