Example #1
0
def test_get_foundation_quantity_bad_systype(mocker):
    
    # Mock the variables class
    variables = mocker.Mock()
    
    foundloc = np.array([[0.0, 13.333, 0],
                         [7.5, -6.667, 0],
                         [-7.5, -6.667, 0]])
    
    test = Loads(variables)
    
    with pytest.raises(ValueError):
        test._get_foundation_quantity("OWC", foundloc)
Example #2
0
def test_get_foundation_quantity(systype, mocker):
    
    # Mock the variables class
    variables = mocker.Mock()
    
    foundloc = np.array([[0.0, 13.333, 0],
                         [7.5, -6.667, 0],
                         [-7.5, -6.667, 0]])
    
    test = Loads(variables)
    result = test._get_foundation_quantity(systype, foundloc)
    
    assert result == 3
Example #3
0
def test_get_foundation_quantity_foundradnew(mocker):
    
    # Mock the variables class
    variables = mocker.Mock()
    
    foundloc = np.array([[0.0, 13.333, 0],
                         [7.5, -6.667, 0],
                         [-7.5, -6.667, 0]])
    
    test = Loads(variables)
    test.foundradnew = 1.
    test.numlines = 1
    
    result = test._get_foundation_quantity('wavefloat', foundloc)
    
    assert result == 1