Пример #1
0
    def test_update_file_only(self):
        """Verify only the file is updated."""
        instance = MockMappable()
        instance.yorm_mapper.reset_mock()

        utilities.update(instance, fetch=False)

        assert not instance.yorm_mapper.fetch.called
        assert instance.yorm_mapper.store.called
Пример #2
0
    def test_update(self):
        """Verify the object and file are updated."""
        instance = MockMappable()
        instance.yorm_mapper.reset_mock()

        utilities.update(instance)

        assert instance.yorm_mapper.fetch.called
        assert instance.yorm_mapper.store.called
Пример #3
0
    def test_update_file_only(self):
        """Verify only the file is updated."""
        instance = MockMappable()
        instance.yorm_mapper.reset_mock()

        utilities.update(instance, fetch=False)

        assert not instance.yorm_mapper.fetch.called
        assert instance.yorm_mapper.store.called
Пример #4
0
    def test_update(self):
        """Verify the object and file are updated."""
        instance = MockMappable()
        instance.yorm_mapper.reset_mock()

        utilities.update(instance)

        assert instance.yorm_mapper.fetch.called
        assert instance.yorm_mapper.store.called
Пример #5
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(instance)
Пример #6
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(instance)