1from UM.PluginObject import PluginObject 2import pytest 3 4 5def test_getId_unhappy(): 6 plugin = PluginObject() 7 with pytest.raises(ValueError): 8 plugin.getPluginId() # We didn't set an id yet. 9 10 11def test_getVersion_unhappy(): 12 plugin = PluginObject() 13 with pytest.raises(ValueError): 14 plugin.getVersion() # We didn't set a version yet. 15 16 17def test_getVersion_happy(): 18 plugin = PluginObject() 19 plugin.setVersion("12.0.0") 20 assert plugin.getVersion() == "12.0.0" 21 22 23def test_getId_happy(): 24 plugin = PluginObject() 25 plugin.setPluginId("UltiBot") 26 assert plugin.getPluginId() == "UltiBot"