MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / test_tls_key_as_uint8array

Function test_tls_key_as_uint8array

sdk/python/tests/test_client.py:199–213  ·  view source on GitHub ↗

Test that TLS key can be converted to bytes with as_uint8array method.

()

Source from the content-addressed store, hash-verified

197
198
199def test_tls_key_as_uint8array():
200 """Test that TLS key can be converted to bytes with as_uint8array method."""
201 client = DstackClient()
202 result = client.get_tls_key()
203
204 # Test full length
205 full_bytes = result.as_uint8array()
206 assert isinstance(full_bytes, bytes)
207 assert len(full_bytes) > 0
208
209 # Test with max_length
210 key_32 = result.as_uint8array(32)
211 assert isinstance(key_32, bytes)
212 assert len(key_32) == 32
213 assert len(key_32) != len(full_bytes)
214
215
216def test_tls_key_with_alt_names():

Callers

nothing calls this directly

Calls 3

get_tls_keyMethod · 0.95
DstackClientClass · 0.90
as_uint8arrayMethod · 0.80

Tested by

no test coverage detected