Skip to content

Commit

Permalink
Merge pull request #68 from fromfall/patch-13
Browse files Browse the repository at this point in the history
Тесты, 6
  • Loading branch information
MikhailErofeev committed Dec 20, 2015
2 parents 3d1aa9c + 79032b1 commit 0fd3958
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions lab6/Petrov/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import unittest
import random
import lab6


class TestSorting(unittest.TestCase):
def test_trivial(self):
arr = [1, 333, 22]
res = lab6.radixsort(arr)
expected = [1, 22, 333]
self.assertFalse(not res) # check res not empty
self.assertEqual(expected, res)

def test_empty(self):
arr = []
res = lab6.radixsort(arr)
expected = []
self.assertEqual(expected, res)

def test_alot(self):
arr = [random.randint(0, 10000) for i in range(100000)]
res = lab6.radixsort(arr)
arr.sort()
self.assertFalse(not res)
self.assertEqual(arr, res)


if __name__ == '__main__':
unittest.main()

0 comments on commit 0fd3958

Please sign in to comment.