-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest_same_structure_as.py
More file actions
36 lines (23 loc) · 1.31 KB
/
test_same_structure_as.py
File metadata and controls
36 lines (23 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from unittest import TestCase
from samestructureas import same_structure_as
class TestSameStructureAs(TestCase):
def test_same_structure_as_01(self):
self.assertEqual(same_structure_as([1, 1, 1], [2, 2, 2]), True)
def test_same_structure_as_02(self):
self.assertEqual(same_structure_as([1, [1, 1]], [2, [2, 2]]), True)
def test_same_structure_as_03(self):
self.assertEqual(same_structure_as([1, [1, 1]], [[2, 2], 2]), False)
def test_same_structure_as_04(self):
self.assertEqual(same_structure_as([1, [1, 1]], [2, [2]]), False)
def test_same_structure_as_05(self):
self.assertEqual(same_structure_as([[[], []]], [[[], []]]), True)
def test_same_structure_as_06(self):
self.assertEqual(same_structure_as([[[], []]], [[1, 1]]), False)
def test_same_structure_as_07(self):
self.assertEqual(same_structure_as([1, [[[1]]]], [2, [[[2]]]]), True)
def test_same_structure_as_08(self):
self.assertEqual(same_structure_as([], 1), False)
def test_same_structure_as_09(self):
self.assertEqual(same_structure_as([], {}), False)
def test_same_structure_as_10(self):
self.assertEqual(same_structure_as([1, '[', ']'], ['[', ']', 1]), True)