-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
64 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"""Tests for MMU support.""" | ||
from prusa.connect.printer import Printer, const | ||
from tests.util import FINGERPRINT, SN | ||
|
||
# pylint: disable=missing-function-docstring | ||
|
||
|
||
class TestPrinterMMU: | ||
"""Test mmu support""" | ||
|
||
def test_init_supported(self): | ||
printer = Printer(const.PrinterType.I3MK3S, SN, FINGERPRINT) | ||
assert printer.mmu_supported is True | ||
|
||
def test_init_unsupported(self): | ||
printer = Printer(const.PrinterType.I3MK3S, | ||
SN, | ||
FINGERPRINT, | ||
mmu_supported=False) | ||
assert printer.mmu_supported is False | ||
|
||
def test_get_info_enabled(self): | ||
printer = Printer(const.PrinterType.I3MK3S, SN, FINGERPRINT) | ||
printer.mmu_enabled = True | ||
|
||
info = printer.get_info() | ||
assert "mmu" in info | ||
assert info["mmu"]["enabled"] is True | ||
|
||
def test_get_info_disabled(self): | ||
printer = Printer(const.PrinterType.I3MK3S, SN, FINGERPRINT) | ||
|
||
info = printer.get_info() | ||
assert "mmu" in info | ||
assert info["mmu"]["enabled"] is False | ||
|
||
def test_get_info_unsuported_mmu(self): | ||
printer = Printer(const.PrinterType.I3MK3S, | ||
SN, | ||
FINGERPRINT, | ||
mmu_supported=False) | ||
|
||
info = printer.get_info() | ||
assert "mmu" not in info |