Exemplo n.º 1
0
 def test_sigma_too_many_bounds(self):
     self.sigma.nbounds = 4
     with self.assertRaises(ValueError):
         OceanSigmaFactory(**self.kwargs)
Exemplo n.º 2
0
 def setUp(self):
     self.sigma = mock.Mock(units=Unit('1'), nbounds=0)
     self.eta = mock.Mock(units=Unit('m'), nbounds=0)
     self.depth = mock.Mock(units=Unit('m'), nbounds=0)
     self.kwargs = dict(sigma=self.sigma, eta=self.eta, depth=self.depth)
     self.factory = OceanSigmaFactory(**self.kwargs)
Exemplo n.º 3
0
 def test_promote_sigma_units_unknown_to_dimensionless(self):
     sigma = mock.Mock(units=Unit("unknown"), nbounds=0)
     self.kwargs["sigma"] = sigma
     factory = OceanSigmaFactory(**self.kwargs)
     self.assertEqual("1", factory.dependencies["sigma"].units)
Exemplo n.º 4
0
 def test_values(self):
     factory = OceanSigmaFactory(**self.kwargs)
     self.assertEqual(factory.dependencies, self.kwargs)
Exemplo n.º 5
0
 def test_depth_incompatible_units(self):
     self.depth.units = Unit("km")
     with self.assertRaises(ValueError):
         OceanSigmaFactory(**self.kwargs)