예제 #1
0
def test_accpet_or_reject_true():
    """
    Test the accept_or_reject function when it is true.
    """
    expected_vaule1 = True
    calculated_value1 = mc_lj_potential.accept_or_reject(-1.0, 0.10)
    assert expected_vaule1 == calculated_value1
예제 #2
0
def test_accpet_or_reject_true_ran():
    """
    Test the accept_or_reject function when energy increase but it is still accepted.
    """
    np.random.seed(354)
    expected_vaule3 = True
    calculated_value3 = mc_lj_potential.accept_or_reject(0.1, 0.10)
    try:
        assert expected_vaule3 == calculated_value3
    finally:
        np.random.seed()
예제 #3
0
def test_accpet_or_reject_false():
    """
    Test the accept_or_reject function when it is False.
    """
    np.random.seed(10)
    expected_vaule2 = False
    calculated_value2 = mc_lj_potential.accept_or_reject(6.0, 0.10)
    try:
        assert expected_vaule2 == calculated_value2
    finally:
        np.random.seed()