Skip to content

Commit

Permalink
Revert "Delete solutions/tests/test_Remove_Duplicate.py"
Browse files Browse the repository at this point in the history
This reverts commit 99b9c12.
  • Loading branch information
safaabuzaid committed Jan 12, 2025
1 parent 9443014 commit 6d6d843
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions solutions/tests/test_Remove_Duplicate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"""
Test module for Remove Duplicate function.
Created on 2024-01-10
Author: Safaa Osman
"""

import unittest

from ..Remove_Duplicates import Remove_Duplicates


class TestRemoveDuplicates(unittest.TestCase):
"""Test the Remove_Duplicates function - some tests are buggy!"""

def test_empty_list(self):
"""It should return [] for an empty list"""
self.assertEqual(Remove_Duplicates([]), [])

def test_no_duplicates(self):
"""It should return the same list for list without duplicates"""
self.assertEqual(Remove_Duplicates([1, 2, 3]), [1, 2, 3])

def test_not_list(self):
"""It should raise AssertionError for non-list input"""
with self.assertRaises(AssertionError):
Remove_Duplicates("123")

def test_All_duplicates(self):
"""It should return the list of one item that duplicates"""
self.assertEqual(Remove_Duplicates([1, 1, 1, 1, 1, 1]), [1])

def test_list_with_duplicates(self):
"""It should return the list without duplicates"""
self.assertEqual(Remove_Duplicates([1, 1, 2, 2, 3, 4]), [1, 2, 3, 4])

def test_Mix_types_of_elements(self):
"""It should return the list of elements without duplicates"""
self.assertEqual(
Remove_Duplicates([1, "Safaa", 3.5, "Safaa", "safaa", 3.5]),
[1, "Safaa", 3.5, "safaa"],
)

0 comments on commit 6d6d843

Please sign in to comment.