Skip to content

Commit bddfab6

Browse files
committed
Address code review comments.
1 parent a8f946e commit bddfab6

6 files changed

Lines changed: 31 additions & 16 deletions

File tree

‎nvdaHelper/ISimpleDOM_sconscript‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ tlbFile,headerFile,iidSourceFile,proxySourceFile,dlldataSourceFile=env.TypeLibra
2424
source=idlFile,
2525
MIDLFLAGS=['/c_ext','/I',Dir('.')],
2626
)
27-
# hack: Ignore midl.exe when deciding to rebuild, as its position in the dependencies
27+
# #7036: hack: Ignore midl.exe when deciding to rebuild, as its position in the dependencies
2828
# is different in the run before the idl files are copied versus subsequent runs.
2929
midl=env.WhereIs(env["MIDL"])
3030
for target in (tlbFile,headerFile,iidSourceFile,proxySourceFile,dlldataSourceFile):

‎nvdaHelper/mathPlayer_sconscript‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ tlbFile,headerFile,iidSourceFile,proxySourceFile,dlldataSourceFile=env.TypeLibra
2121
source=idlFile,
2222
MIDLFLAGS=['/I',Dir('.')],
2323
)
24-
# hack: Ignore midl.exe when deciding to rebuild, as its position in the dependencies
24+
# #7036: hack: Ignore midl.exe when deciding to rebuild, as its position in the dependencies
2525
# is different in the run before the idl files are copied versus subsequent runs.
2626
midl=env.WhereIs(env["MIDL"])
2727
for target in (tlbFile,headerFile,iidSourceFile,proxySourceFile,dlldataSourceFile):
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
(dp1
2+
S'pendingInstallsSet'
3+
p2
4+
c__builtin__
5+
set
6+
p3
7+
((ltRp4
8+
sS'pendingRemovesSet'
9+
p5
10+
g3
11+
((ltRp6
12+
s.

‎tests/system/test_foo.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from . import TestCase
2+
3+
class TestCase(TestCase):
4+
5+
def test_foo(self):
6+
self.keyCommand("NVDA+c")
7+
self.expectPresentation([r"Speaking [u'asdf']"])

‎tests/unit/__init__.py‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
All unit tests should reside within this package and should be
99
divided into modules and packages similar to the code they are testing.
1010
Test modules must have a C{test_} prefix
11-
and should contain one or more classes with a C{Test} prefix which subclass L{TestCase}.
11+
and should contain one or more classes with a C{Test} prefix which subclass C{unittest.TestCase}.
1212
Methods in test classes should have a C{test_} prefix.
1313
"""
1414

@@ -45,7 +45,8 @@ class AppArgs:
4545
# The path to this package might be relative, so make it absolute,
4646
# since we just changed directory.
4747
__path__[0] = UNIT_DIR
48-
# We don't want logging.
48+
# We don't want logging for now,
49+
# though we may optionally want this in future; see #7045.
4950
import logging
5051
from logHandler import log
5152
log.addHandler(logging.NullHandler())
@@ -79,11 +80,3 @@ class PlaceholderNVDAObject(NVDAObject):
7980
import speech
8081
speech.speak = lambda speechSequence, symbolLevel=None: None
8182
speech.speakSpelling = lambda text, locale=None, useCharacterDescriptions=False: None
82-
83-
### Base classes/utility functions.
84-
85-
import unittest
86-
87-
class TestCase(unittest.TestCase):
88-
"""The base class which all test case classes should subclass.
89-
"""

‎tests/unit/test_cursorManager.py‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99

1010
import unittest
1111
import cursorManager
12-
from . import TestCase
1312
from .textProvider import BasicTextProvider
1413

1514
class CursorManager(cursorManager.CursorManager, BasicTextProvider):
1615
"""CursorManager which navigates within a provided string of text.
1716
"""
1817

19-
class TestMove(TestCase):
18+
class TestMove(unittest.TestCase):
2019

2120
def test_nextChar(self):
2221
cm = CursorManager(text="abc") # Caret at "a"
@@ -28,7 +27,7 @@ def test_prevChar(self):
2827
cm.script_moveByCharacter_back(None)
2928
self.assertEqual(cm.selectionOffsets, (0, 0)) # Caret at "a"
3029

31-
class TestSelection(TestCase):
30+
class TestSelection(unittest.TestCase):
3231

3332
def test_selectNextChar(self):
3433
cm = CursorManager(text="abc") # Caret at "a"
@@ -41,13 +40,16 @@ def test_selectPrevChar(self):
4140
self.assertEqual(cm.selectionOffsets, (0, 1)) # "a" selected
4241

4342
def test_unselectPrevChar(self):
43+
"""Depends on behavior tested by test_selectNextChar.
44+
"""
4445
cm = CursorManager(text="abc") # Caret at "a"
4546
cm.script_selectCharacter_forward(None) # "a" selected
4647
cm.script_selectCharacter_back(None) # "a" unselected
4748
self.assertEqual(cm.selectionOffsets, (0, 0)) # Caret at "a", no selection
4849

4950
def test_selForwardThenUnselThenSelBackward(self):
5051
"""Test selecting forward, then unselecting and selecting backward.
52+
Depends on behavior tested by test_unselectPrevChar.
5153
"""
5254
cm = CursorManager(text="abc", selection=(1, 1)) # Caret at "b"
5355
cm.script_selectCharacter_forward(None) # "b" selected
@@ -57,13 +59,14 @@ def test_selForwardThenUnselThenSelBackward(self):
5759

5860
def test_selectForwardThenSelBackward(self):
5961
"""Test selecting forward, then selecting backward without unselecting.
62+
Depends on behavior tested by test_selectNextChar.
6063
"""
6164
cm = CursorManager(text="abc", selection=(1, 1)) # Caret at "b"
6265
cm.script_selectCharacter_forward(None) # "b" selected
6366
cm.script_selectWord_back(None) # "b" unselected, "a" selected
6467
self.assertEqual(cm.selectionOffsets, (0, 1)) # "a" selected
6568

66-
class TestSelectAll(TestCase):
69+
class TestSelectAll(unittest.TestCase):
6770
"""Tests the select all command starting from different caret positions.
6871
"""
6972

0 commit comments

Comments
 (0)