def test_measurement_noclothes(): tracker = Tracker(skeleton=False) fitnesslog = FitnessLog("fitness log", None, tracker.root) fitnesslog._validate() tracker.root.addchild(fitnesslog) measurement = SimpleMeasurement("_", "herp 1234 abc", fitnesslog) measurement._validate() fitnesslog.addchild(measurement) assert measurement.the_value == 1234 assert measurement.clothes is None
def test_measurement_text(): tracker = Tracker(skeleton=False) fitnesslog = FitnessLog("fitness log", None, tracker.root) fitnesslog._validate() tracker.root.addchild(fitnesslog) measurement = SimpleMeasurement("_", "herp 1234 abc wearing a pot roast", fitnesslog) measurement._validate() fitnesslog.addchild(measurement) assert measurement.text == "herp 1234 abc wearing a pot roast" measurement.text = measurement.text assert measurement.text == "herp 1234 abc wearing a pot roast"
def test_measurement_time(): tracker = Tracker(skeleton=False) fitnesslog = FitnessLog("fitness log", None, tracker.root) fitnesslog._validate() tracker.root.addchild(fitnesslog) measurement = SimpleMeasurement("_", "herp 1234 abc wearing a pot roast", fitnesslog, nodeid="abcde") measurement._validate() fitnesslog.addchild(measurement) result = serialize_to_str(measurement, is_root=False) assert result.startswith( "_#abcde: herp 1234 abc wearing a pot roast\n" " @time: " )