示例#1
0
    def test_update(self):
        """Verify only the object is updated."""
        instance = MockMappable()
        instance.yorm_mapper.reset_mock()

        utilities.update_object(instance)

        assert instance.yorm_mapper.fetch.called
        assert not instance.yorm_mapper.store.called
示例#2
0
    def test_update(self):
        """Verify only the object is updated."""
        instance = MockMappable()
        instance.yorm_mapper.reset_mock()

        utilities.update_object(instance)

        assert instance.yorm_mapper.fetch.called
        assert not instance.yorm_mapper.store.called
示例#3
0
    def test_update_wrong_base(self):
        """Verify an exception is raised with the wrong base."""
        instance = Mock()

        with pytest.raises(common.UseageError):
            utilities.update_object(instance)
示例#4
0
    def test_update_wrong_base(self):
        """Verify an exception is raised with the wrong base."""
        instance = Mock()

        with pytest.raises(common.UseageError):
            utilities.update_object(instance)