Exemple #1
0
 def test_empty(self):
     self.assertEquals(util.init_list(0.0, [0]), [])
Exemple #2
0
 def test_multiple_levels(self):
     self.assertEquals(
         util.init_list(3.25, [3, 2, 1]),
         [[[3.25], [3.25]], [[3.25], [3.25]], [[3.25], [3.25]]])
Exemple #3
0
 def test_nested_single(self):
     self.assertEquals(util.init_list(1.0, [1, 1, 1, 1]), [[[[1.0]]]])
Exemple #4
0
 def test_single_level(self):
     self.assertEquals(util.init_list(2.0, [4]), [2.0, 2.0, 2.0, 2.0])
Exemple #5
0
 def test_single_element(self):
     self.assertEquals(util.init_list(1.0, [1]), [1.0])