|
|
@@ -1505,6 +1505,63 @@ class TestNo3MFWarningReason:
|
|
|
|
|
|
assert response.json() == {"has_fallback": False, "reason": None}
|
|
|
|
|
|
+ @pytest.mark.asyncio
|
|
|
+ @pytest.mark.integration
|
|
|
+ async def test_a_refused_handshake_is_reported(
|
|
|
+ self, async_client: AsyncClient, archive_factory, printer_factory, db_session
|
|
|
+ ):
|
|
|
+ """#2957 stamps this slug and #2780 never taught the banner about it, so
|
|
|
+ an install whose only empty archives came from a printer refusing TLS on
|
|
|
+ port 990 was told the slicer had not written the file to the card. The
|
|
|
+ slicer had; nothing could read it back. The reporter could see the file
|
|
|
+ on the stick from his own computer, which is exactly why the advice read
|
|
|
+ as Bambuddy being broken.
|
|
|
+ """
|
|
|
+ printer = await printer_factory()
|
|
|
+ await archive_factory(
|
|
|
+ printer.id,
|
|
|
+ extra_data={"no_3mf_available": True, "no_3mf_reason": "ftps_cooloff"},
|
|
|
+ )
|
|
|
+
|
|
|
+ response = await async_client.get("/api/v1/archives/no-3mf-warning")
|
|
|
+
|
|
|
+ assert response.json() == {"has_fallback": True, "reason": "ftps_cooloff"}
|
|
|
+
|
|
|
+ @pytest.mark.asyncio
|
|
|
+ @pytest.mark.integration
|
|
|
+ async def test_a_refused_handshake_outranks_every_settled_cause(
|
|
|
+ self, async_client: AsyncClient, archive_factory, printer_factory, db_session
|
|
|
+ ):
|
|
|
+ """The other three describe an install working as configured. This one
|
|
|
+ reports a printer doing something we cannot yet explain, and the banner
|
|
|
+ dismisses one-shot into localStorage -- so a reason ranked below another
|
|
|
+ is not deferred, it is never shown to that user at all.
|
|
|
+ """
|
|
|
+ printer = await printer_factory()
|
|
|
+ for reason in ("internal_storage", "no_external_storage", "internal_history"):
|
|
|
+ await archive_factory(printer.id, extra_data={"no_3mf_available": True, "no_3mf_reason": reason})
|
|
|
+ await archive_factory(printer.id, extra_data={"no_3mf_available": True, "no_3mf_reason": "ftps_cooloff"})
|
|
|
+
|
|
|
+ response = await async_client.get("/api/v1/archives/no-3mf-warning")
|
|
|
+
|
|
|
+ assert response.json() == {"has_fallback": True, "reason": "ftps_cooloff"}
|
|
|
+
|
|
|
+ @pytest.mark.asyncio
|
|
|
+ @pytest.mark.integration
|
|
|
+ async def test_the_settled_causes_keep_their_order_behind_it(
|
|
|
+ self, async_client: AsyncClient, archive_factory, printer_factory, db_session
|
|
|
+ ):
|
|
|
+ """Adding a new leader must not disturb the ranking underneath it: an
|
|
|
+ install with no refused handshake still gets exactly what it got before.
|
|
|
+ """
|
|
|
+ printer = await printer_factory()
|
|
|
+ await archive_factory(printer.id, extra_data={"no_3mf_available": True, "no_3mf_reason": "internal_history"})
|
|
|
+ await archive_factory(printer.id, extra_data={"no_3mf_available": True, "no_3mf_reason": "no_external_storage"})
|
|
|
+
|
|
|
+ response = await async_client.get("/api/v1/archives/no-3mf-warning")
|
|
|
+
|
|
|
+ assert response.json() == {"has_fallback": True, "reason": "no_external_storage"}
|
|
|
+
|
|
|
|
|
|
class TestPrintLogEntryDelete:
|
|
|
"""#1687: per-row delete on the Print Log page.
|