def test_does_not_add_not_expired_materials(self):
        storage = InMemoryStorage()
        girl = Materializer(storage=storage)

        girl.add_material(
            'test',
            lambda: 'woot'
        )

        girl.run()

        storage.items = {}

        girl.run()

        expect(storage.items).to_be_empty()
Пример #2
0
    def test_can_update_deleted_materials(self):
        storage = InMemoryStorage()
        girl = Materializer(storage=storage)

        woots = self.woots_generator()

        girl.add_material("test", lambda: next(woots))

        girl.run()

        expect(storage.items).to_length(1)
        expect(storage.items["test"]).to_equal("woot1")

        storage.items = {}

        girl.run()

        expect(storage.items).to_length(1)
        expect(storage.items["test"]).to_equal("woot2")