コード例 #1
0
def test_bond_check_true():
    minval = 0.3
    maxval = 1.8
    bondlength = 1.6
    observed = ga.bond_check(bondlength, minval, maxval)

    assert observed == True
コード例 #2
0
def test_bond_check_0(): # Write a test for the bond_check function in geometry_analysis.py
    
    bond_distance = 0 # Make a fake distance
    
    expected = False # Define expected result
    
    observed = ga.bond_check(bond_distance) # Ask the function to determine if bond is True or False
    
    assert observed == expected # "assert" statement
コード例 #3
0
def test_bond_check_error():
    bond_length = 'a'

    with pytest.raises(TypeError):
        observed = ga.bond_check(bond_length)
コード例 #4
0
def test_bond_check_true():
    bond_distance = 1.4
    observed = ga.bond_check(bond_distance)
    assert observed == True
コード例 #5
0
def test_bond_check_false():
    bond_distance = 3.0
    observed = ga.bond_check(bond_distance)
    assert observed == False
コード例 #6
0
def test_bond_check_false():
    bondlength = 1.9
    observed = ga.bond_check(bondlength)

    assert observed == False
コード例 #7
0
def test_bond_check_1p6():
    bond_distance = 1.6
    expected = False
    observed = ga.bond_check(bond_distance)

    assert expected == observed
コード例 #8
0
def test_bond_check():
    bond_distance = 1.0
    expected = True
    observed = ga.bond_check(bond_distance)

    assert expected == observed