Skip to content

Commit

Permalink
Reorganize tests
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Mar 24, 2024
1 parent 384ce68 commit 28adc18
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
22 changes: 0 additions & 22 deletions tests/test_3141596.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
from unittest import skipIf
from unittesting import AWAIT_WORKER
from unittesting import DeferrableTestCase
from unittesting.helpers import TempDirectoryTestCase
from unittesting.helpers import ViewTestCase
from unittesting.utils import isiterable

BASEDIR = os.path.dirname(os.path.abspath(__file__))
Expand Down Expand Up @@ -199,23 +197,3 @@ def test_fail_color_scheme(self, txt):
@with_package("_ColorScheme_Success", color_scheme_test=True)
def test_success_color_scheme(self, txt):
self.assertOk(txt)


def tidy_path(path):
return os.path.realpath(os.path.normcase(path))


class TestTempDirectoryTestCase(TempDirectoryTestCase):

def test_temp_dir(self):
self.assertTrue(
tidy_path(self._temp_dir),
tidy_path(self.window.folders()[0])
)


class TestViewTestCase(ViewTestCase):

def test_view(self):
self.assertIsInstance(self.view, sublime.View)
self.assertTrue(self.view.is_valid())
2 changes: 2 additions & 0 deletions tests/test_deferrable_view_test_case.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sublime

from unittesting import DeferrableViewTestCase


Expand All @@ -9,6 +10,7 @@ def test_window_object(self):

def test_view_object(self):
self.assertIsInstance(self.view, sublime.View)
self.assertTrue(self.view.is_valid())

def test_view_settings(self):
for key, value in self.view_settings.items():
Expand Down
16 changes: 16 additions & 0 deletions tests/test_directory_test_case.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os

from unittesting import TempDirectoryTestCase


def tidy_path(path):
return os.path.realpath(os.path.normcase(path))


class TestTempDirectoryTestCase(TempDirectoryTestCase):

def test_temp_dir(self):
self.assertTrue(
tidy_path(self._temp_dir),
tidy_path(self.window.folders()[0])
)
2 changes: 2 additions & 0 deletions tests/test_view_test_case.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sublime

from unittesting import ViewTestCase


Expand All @@ -9,6 +10,7 @@ def test_window_object(self):

def test_view_object(self):
self.assertIsInstance(self.view, sublime.View)
self.assertTrue(self.view.is_valid())

def test_view_settings(self):
for key, value in self.view_settings.items():
Expand Down

0 comments on commit 28adc18

Please sign in to comment.