import hoomd


def test_before_attaching():
    filt = hoomd.filter.All()
    thermoHMA = hoomd.md.compute.ThermoHMA(filt, 1.0)
    assert thermoHMA._filter == filt
    assert thermoHMA.temperature == 1.0
    assert thermoHMA.harmonicPressure == 0.0
    assert thermoHMA.potential_energyHMA is None
    assert thermoHMA.pressureHMA is None

    thermoHMA = hoomd.md.compute.ThermoHMA(filt, 2.5, 0.6)
    assert thermoHMA.temperature == 2.5
    assert thermoHMA.harmonicPressure == 0.6

@@ -478,8 +478,613 @@
  == 0.6%0A
+%0A%0Adef test_after_attaching(simulation_factory, two_particle_snapshot_factory):%0A    filt = hoomd.filter.All()%0A    thermoHMA = hoomd.md.compute.ThermoHMA(filt, 1.0)%0A%0A    sim = simulation_factory(two_particle_snapshot_factory())%0A    sim.operations.add(thermoHMA)%0A    assert len(sim.operations.computes) == 1%0A    sim.run(0)%0A    assert isinstance(thermoHMA.potential_energyHMA, float)%0A    assert isinstance(thermoHMA.pressureHMA, float)%0A%0A    sim.operations.remove(thermoHMA)%0A    assert len(sim.operations.computes) == 0%0A    assert thermoHMA.potential_energyHMA is None%0A    assert thermoHMA.pressureHMA is None%0A

Test after attaching