Ejemplo n.º 1
0
def test_OilProps_sample_oil(oil, density, units):
    """ compare expected values with values stored in OilProps - make sure
    data entered correctly and unit conversion is correct """

    o = OilProps(oil)
    assert o.get_density(units) == density
    assert o.name == oil
Ejemplo n.º 2
0
def test_initailize_InitMassFromVolume():
    data_arrays = mock_append_data_arrays(mass_array, num_elems)
    substance = OilProps('oil_conservative')

    spill = Spill(Release(10))
    spill.volume = num_elems / (substance.get_density('kg/m^3') * 1000)

    fcn = InitMassFromVolume()
    fcn.initialize(num_elems, spill, data_arrays, substance)

    assert_dataarray_shape_size(mass_array, data_arrays, num_elems)
    assert np.all(1. == data_arrays['mass'])