Test to_keypair with TLS key response (should show warning).
()
| 49 | |
| 50 | |
| 51 | def test_to_keypair_with_tls_key(): |
| 52 | """Test to_keypair with TLS key response (should show warning).""" |
| 53 | client = DstackClient() |
| 54 | result = client.get_tls_key() |
| 55 | |
| 56 | with warnings.catch_warnings(record=True) as w: |
| 57 | warnings.simplefilter("always") |
| 58 | keypair = to_keypair(result) |
| 59 | |
| 60 | assert isinstance(keypair, Keypair) |
| 61 | assert len(w) == 1 |
| 62 | assert issubclass(w[0].category, DeprecationWarning) |
| 63 | assert "Please don't use getTlsKey method" in str(w[0].message) |
| 64 | |
| 65 | |
| 66 | def test_to_keypair_secure_with_tls_key(): |
nothing calls this directly
no test coverage detected