Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_array_resize(self):
self.assertEqual(array_resize(array=[1, 2, 3, 4, 5], length=2), [1, 2])
self.assertEqual(array_resize(array=[1, 2, 3, 4, 5], length=2, array_len=5), [1, 2])
self.assertEqual(array_resize(array=[1, 2], length=5, array_len=2), [1, 2, 1, 2, 1])
# when a tuple is passed
self.assertEqual(array_resize(array=(1, 2), length=5, array_len=2), (1, 2, 1, 2, 1))
def test_array_resize(self):
self.assertEqual(array_resize(array=[1, 2, 3, 4, 5], length=2), [1, 2])
self.assertEqual(array_resize(array=[1, 2, 3, 4, 5], length=2, array_len=5), [1, 2])
self.assertEqual(array_resize(array=[1, 2], length=5, array_len=2), [1, 2, 1, 2, 1])
# when a tuple is passed
self.assertEqual(array_resize(array=(1, 2), length=5, array_len=2), (1, 2, 1, 2, 1))