File: TestPluginObject.py

package info (click to toggle)
uranium 5.0.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,304 kB
  • sloc: python: 31,765; sh: 132; makefile: 12
file content (26 lines) | stat: -rw-r--r-- 627 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from UM.PluginObject import PluginObject
import pytest


def test_getId_unhappy():
    plugin = PluginObject()
    with pytest.raises(ValueError):
        plugin.getPluginId()  # We didn't set an id yet.


def test_getVersion_unhappy():
    plugin = PluginObject()
    with pytest.raises(ValueError):
        plugin.getVersion()  # We didn't set a version yet.


def test_getVersion_happy():
    plugin = PluginObject()
    plugin.setVersion("12.0.0")
    assert plugin.getVersion() == "12.0.0"


def test_getId_happy():
    plugin = PluginObject()
    plugin.setPluginId("UltiBot")
    assert plugin.getPluginId() == "UltiBot"