mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-05-21 07:26:49 +00:00
16 lines
496 B
Python
16 lines
496 B
Python
from unittest import TestCase
|
|
|
|
from app.utils.structures import ListUtils
|
|
|
|
|
|
class ListUtilsTest(TestCase):
|
|
def test_flatten_keeps_scalar_items_in_mixed_list(self):
|
|
self.assertEqual(ListUtils.flatten([1, [2, 3], 4]), [1, 2, 3, 4])
|
|
|
|
def test_flatten_returns_plain_list_unchanged(self):
|
|
source = [1, 2, 3]
|
|
self.assertEqual(ListUtils.flatten(source), source)
|
|
|
|
def test_flatten_rejects_non_list_input(self):
|
|
self.assertEqual(ListUtils.flatten("1,2,3"), [])
|