def test_report_changed(self): change = [["test_attr", "test_value"], 12] parent = Mock() n = Monitorable() n.set_parent(parent, "test_n") notify = Mock() n.report_changes(change) expected = [["test_n", "test_attr", "test_value"], 12] parent.report_changes.assert_called_once_with(expected)
def test_nop_with_no_parent(self): change = [["test"], 123] n = Monitorable() self.assertIsNone(n._parent) n.report_changes(change) self.assertEquals([["test"], 123], change)