Skip to content

Commit 269bed7

Browse files
move test to tests
--HG-- branch : scroll-frontend
1 parent 0fba7ef commit 269bed7

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

bpython/scrollfrontend/abbreviate.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,3 @@ def update_abbrs_with_vim_abbrs():
3838
abbrs = python_vim_abbreviations()
3939
ABBR.update(abbrs)
4040

41-
if __name__ == '__main__':
42-
abbrs = python_vim_abbreviations()
43-
print abbrs
44-
ABBR.update(abbrs)
45-
print(substitute_abbreviations(0, 'improt asdf'))
46-
print(substitute_abbreviations(0, 'foo(x, y() - 2.3242) + "asdf"'))

bpython/test/test_abbreviate.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import bpython.scrollfrontend.abbreviate as abbreviate
2+
import unittest
3+
4+
class TestAbbreviate(unittest.TestCase):
5+
6+
def test_substitution(self):
7+
self.assertEqual(abbreviate.substitute_abbreviations(0, 'improt asdf'), (0, 'import asdf'))
8+
9+
def test_no_substitution(self):
10+
self.assertEqual(abbreviate.substitute_abbreviations(0, 'foo(x, y() - 2.3242) + "asdf"'), (0, 'foo(x, y() - 2.3242) + "asdf"'))
11+
12+
if __name__ == '__main__':
13+
unittest.main()

0 commit comments

Comments
 (0)