Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Python 3.12 compatibility #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions tests/casts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
class TestControl(unittest.TestCase):

def test_casts_yes_no(self):
self.failUnlessEqual(casts.yes_no('y'), True)
self.failUnlessEqual(casts.yes_no('n'), False)
self.failUnlessEqual(casts.yes_no('Yes'), True)
self.failUnlessEqual(casts.yes_no('nO'), False)
self.failUnlessRaises(ValueError, casts.yes_no, 'spam')
self.assertEqual(casts.yes_no('y'), True)
self.assertEqual(casts.yes_no('n'), False)
self.assertEqual(casts.yes_no('Yes'), True)
self.assertEqual(casts.yes_no('nO'), False)
self.assertRaises(ValueError, casts.yes_no, 'spam')

def test_casts_file(self):
self.failUnlessEqual( type(casts.file(__file__)), type(open(__file__)) )
self.failUnlessRaises(ValueError, casts.file, '')
self.assertEqual( type(casts.file(__file__)), type(open(__file__)) )
self.assertRaises(ValueError, casts.file, '')


if __name__ == '__main__':
Expand Down
12 changes: 6 additions & 6 deletions tests/rlcomplete_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ class TestControl(unittest.TestCase):

def test_ListCompleter(self):
c = rlcomplete.ListCompleter(['foo','bar','baz'], True)
self.failUnlessEqual(c.completelist('a'), [])
self.failUnlessEqual(c.completelist('B'), ['bar','baz'])
self.failUnlessEqual(c.completelist('f'), ['foo'])
self.assertEqual(c.completelist('a'), [])
self.assertEqual(c.completelist('B'), ['bar','baz'])
self.assertEqual(c.completelist('f'), ['foo'])
c = rlcomplete.ListCompleter(['foo','bar','baz'], False)
self.failUnlessEqual(c.completelist('B'), [])
self.failUnlessEqual(c.completelist('b'), ['bar','baz'])
self.assertEqual(c.completelist('B'), [])
self.assertEqual(c.completelist('b'), ['bar','baz'])

def test_PathCompleter(self):
#c = rlcomplete.PathCompleter()
#self.failUnlessEqual(c.completelist('m'), ['manual/'])
#self.assertEqual(c.completelist('m'), ['manual/'])
pass

if __name__ == '__main__':
Expand Down