Ejemplo n.º 1
0
 def test_removeNotExistingFavorite(self, application):
     with patch("UM.Application.Application.getInstance",
                MagicMock(return_value=application)):
         manager = MaterialManager(mocked_registry)
         manager.materialsUpdated = MagicMock()
         manager.removeFavorite("blarg")
         manager.materialsUpdated.emit.assert_not_called()
Ejemplo n.º 2
0
    def test_removeExistingFavorite(self, application):
        with patch("UM.Application.Application.getInstance", MagicMock(return_value=application)):
            manager = MaterialManager(mocked_registry)
            manager.materialsUpdated = MagicMock()
            manager.addFavorite("blarg")

            manager.removeFavorite("blarg")
            assert manager.materialsUpdated.emit.call_count == 2
            application.getPreferences().setValue.assert_called_with("cura/favorite_materials", "")
            assert manager.getFavorites() == set()
Ejemplo n.º 3
0
    def test_removeExistingFavorite(self, application):
        with patch("UM.Application.Application.getInstance", MagicMock(return_value=application)):
            manager = MaterialManager(mocked_registry)
            manager.materialsUpdated = MagicMock()
            manager.addFavorite("blarg")

            manager.removeFavorite("blarg")
            assert manager.materialsUpdated.emit.call_count == 2
            application.getPreferences().setValue.assert_called_with("cura/favorite_materials", "")
            assert manager.getFavorites() == set()
Ejemplo n.º 4
0
 def test_removeNotExistingFavorite(self, application):
     with patch("UM.Application.Application.getInstance", MagicMock(return_value=application)):
         manager = MaterialManager(mocked_registry)
         manager.materialsUpdated = MagicMock()
         manager.removeFavorite("blarg")
         manager.materialsUpdated.emit.assert_not_called()