コード例 #1
0
 def test_bigint(self):
     self.assertEqual(earl.pack(1200), bytes([131, 98, 0, 0, 4, 176]))
コード例 #2
0
 def test_nil(self):
     self.assertEqual(earl.pack([]), bytes([131, 106]))
コード例 #3
0
 def test_smallint(self):
     self.assertEqual(earl.pack(10), bytes([131, 97, 10]))
コード例 #4
0
 def test_map(self):
     self.assertEqual(
         earl.pack({"d": 10}),
         bytes([131, 116, 0, 0, 0, 1, 109, 0, 0, 0, 1, 100, 97, 10]))
コード例 #5
0
 def test_list(self):
     self.assertEqual(
         earl.pack([1, 2, 3]),
         bytes([131, 108, 0, 0, 0, 3, 97, 1, 97, 2, 97, 3, 106]))
コード例 #6
0
 def test_floats(self):
     self.assertEqual(earl.pack(3.141592),
                      bytes([131, 70, 64, 9, 33, 250, 252, 139, 0, 122]))
コード例 #7
0
ファイル: websocket.py プロジェクト: Nemra1/discord-clone-1
def encode_etf(payload) -> str:
    return earl.pack(payload)
コード例 #8
0
ファイル: etf.py プロジェクト: elderlabs/BetterDisco
 def encode(obj):
     return pack(obj)
コード例 #9
0
ファイル: gateway.py プロジェクト: vault-the/curious
 def _dumper(data: dict):
     return earl.pack(data)
コード例 #10
0
async def etf_encoder(obj):
    return earl.pack(obj)