Beispiel #1
0
 def test_zero_is_invalid(self):
     with self.assertRaises(ValueError):
         g.validate_dimensions(0)
Beispiel #2
0
 def test_negative_is_invalid(self):
     with self.assertRaises(ValueError):
         g.validate_dimensions(-1)
Beispiel #3
0
 def test_value_error_on_conversion_to_integer_raises_value_error(self):
     with self.assertRaises(ValueError):
         g.validate_dimensions('a')
Beispiel #4
0
 def test_valid_number_as_string(self):
     self.assertEqual(g.validate_dimensions('4'), 4)
Beispiel #5
0
 def test_valid_number(self):
     self.assertEqual(g.validate_dimensions(3), 3)
Beispiel #6
0
 def test_explicit_none_returns_default(self):
     self.assertEqual(g.validate_dimensions(None), g.default_num_dimensions)
Beispiel #7
0
 def test_unpassed_returns_default(self):
     self.assertEqual(g.validate_dimensions(), g.default_num_dimensions)