Ejemplo n.º 1
0
 def test_make_even_mask_from_negative_indices(self):
     indices_to_punch = [-12, -10, -8, -6, -4, -2]
     evens = Mask.from_indices(size=12, indices_to_punch=indices_to_punch)
     self.assertEqual(self.even_are_punched, evens)
Ejemplo n.º 2
0
 def test_make_odd_mask_from_negative_indices(self):
     indices_to_punch = [-11, -9, -7, -5, -3, -1]
     odds = Mask.from_indices(size=12, indices_to_punch=indices_to_punch)
     self.assertEqual(self.odd_are_punched, odds)
Ejemplo n.º 3
0
 def test_make_odd_mask_from_indices(self):
     indices_to_punch = [1, 3, 5, 7, 9, 11]
     odds = Mask.from_indices(size=12, indices_to_punch=indices_to_punch)
     self.assertEqual(self.odd_are_punched, odds)
Ejemplo n.º 4
0
 def test_make_even_mask_from_indices(self):
     indices_to_punch = [0, 2, 4, 6, 8, 10]
     evens = Mask.from_indices(size=12, indices_to_punch=indices_to_punch)
     self.assertEqual(self.even_are_punched, evens)
Ejemplo n.º 5
0
 def test_make_mask_from_indices_too_small(self):
     with self.assertRaises(AssertionError) as context:
         indices_to_punch = [-13, -10, -2]
         evens = Mask.from_indices(size=12,
                                   indices_to_punch=indices_to_punch)
         self.assertEqual(self.even_are_punched, evens)
Ejemplo n.º 6
0
 def test_make_mask_from_indices_too_large(self):
     with self.assertRaises(AssertionError) as context:
         indices_to_punch = [0, 2, 4, 14, 10]
         evens = Mask.from_indices(size=12,
                                   indices_to_punch=indices_to_punch)
Ejemplo n.º 7
0
 def test_make_mask_from_indices_size_is_0(self):
     with self.assertRaises(AssertionError) as context:
         indices_to_punch = [0, 2, 4, 6, 8, 10]
         evens = Mask.from_indices(size=0,
                                   indices_to_punch=indices_to_punch)