#273: Remove nose dependency for online_judges/ (#282)

This commit is contained in:
Donne Martin
2020-07-14 21:34:08 -04:00
committed by GitHub
parent 67505c49b2
commit 46d3939632
60 changed files with 575 additions and 782 deletions

View File

@@ -1,23 +1,23 @@
from nose.tools import assert_equal, assert_raises
import unittest
class TestSolution(object):
class TestSolution(unittest.TestCase):
def test_format_license_key(self):
solution = Solution()
assert_raises(TypeError, solution.format_license_key, None, None)
self.assertRaises(TypeError, solution.format_license_key, None, None)
license_key = '---'
k = 3
expected = ''
assert_equal(solution.format_license_key(license_key, k), expected)
self.assertEqual(solution.format_license_key(license_key, k), expected)
license_key = '2-4A0r7-4k'
k = 3
expected = '24-A0R-74K'
assert_equal(solution.format_license_key(license_key, k), expected)
self.assertEqual(solution.format_license_key(license_key, k), expected)
license_key = '2-4A0r7-4k'
k = 4
expected = '24A0-R74K'
assert_equal(solution.format_license_key(license_key, k), expected)
self.assertEqual(solution.format_license_key(license_key, k), expected)
print('Success: test_format_license_key')
def main():
@@ -26,4 +26,4 @@ def main():
if __name__ == '__main__':
main()
main()