def test_acic_does_not_raise_if_newer(root): c = Component() c.last_updated = Mock(return_value=22) root.component += c c2 = Component() c2.last_updated = Mock(return_value=21) c.assert_component_is_current(c2)
def test_acic_accepts_multiple_components(root): c = Component() c.last_updated = Mock(return_value=20) root.component += c c2 = Component() c2.last_updated = Mock(return_value=21) with pytest.raises(batou.UpdateNeeded): c.assert_component_is_current([c2, c2])
def test_acic_raises_if_older_reference(root): c = Component() c.last_updated = Mock(return_value=20) root.component += c c2 = Component() c2.last_updated = Mock(return_value=21) with pytest.raises(batou.UpdateNeeded): c.assert_component_is_current(c2)