Exemplo n.º 1
0
 def test_uuid__super(self):
     guid = ExtendedUUID('522d6f3519204b0fb82ae8f558af2749')
     with pytest.raises(TypeError) as e:
         format(guid, 'does not exist')
     assert 'unsupported format string passed to ExtendedUUID.__format__' in str(e)
Exemplo n.º 2
0
 def test_precision(self):
     guid = ExtendedUUID('522d6f3519204b0fb82ae8f558af2749')
     assert len(format(guid, '.11base64')) == 11
     assert format(guid, '.11base64') == 'Ui1vNRkgSw-'
Exemplo n.º 3
0
 def test_uuid_2_base32(self):
     guid = ExtendedUUID('522d6f3519204b0fb82ae8f558af2749')
     assert isinstance(format(guid, 'base32'), str)
     assert len(format(guid, 'base32')) == 26
     assert '=' not in format(guid, 'base32'), "Trim padding"
     assert format(guid, 'base32') == 'KIWW6NIZEBFQ7OBK5D2VRLZHJE'
Exemplo n.º 4
0
 def test_uuid_2_base64(self):
     guid = ExtendedUUID('522d6f3519204b0fb82ae8f558af2749')
     assert isinstance(format(guid, 'base64'), str)
     assert len(format(guid, 'base64')) == 22
     assert '=' not in format(guid, 'base64'), "Trim padding"
     assert format(guid, 'base64') == 'Ui1vNRkgSw-4Kuj1WK8nSQ'
Exemplo n.º 5
0
 def test_uuid_2_base16_lower(self):
     guid = ExtendedUUID('522d6f3519204b0fb82ae8f558af2749')
     assert isinstance(format(guid, 'x'), str)
     assert len(format(guid, 'x')) == 32
     assert format(guid, 'x') == '522d6f3519204b0fb82ae8f558af2749'
Exemplo n.º 6
0
 def test_uuid_2_base16_upper(self):
     guid = ExtendedUUID('522d6f3519204b0fb82ae8f558af2749')
     assert isinstance(format(guid, 'X'), str)
     assert len(format(guid, 'X')) == 32
     assert format(guid, 'X') == '522D6F3519204B0FB82AE8F558AF2749'
Exemplo n.º 7
0
 def get_uuid():
     return ExtendedUUID('522d6f3519204b0fb82ae8f558af2749')
Exemplo n.º 8
0
 def test_uuid_2_base10(self):
     guid = ExtendedUUID('522d6f3519204b0fb82ae8f558af2749')
     assert isinstance(format(guid, 'i'), str)
     assert len(format(guid, 'i')) == 39
     assert format(guid, 'i') == '109232604567331952752042348453722793801'
 def test_precision(self):
     guid = ExtendedUUID("522d6f3519204b0fb82ae8f558af2749")
     assert len(format(guid, ".11base64")) == 11
     assert format(guid, ".11base64") == "Ui1vNRkgSw-"
 def test_uuid_2_base64(self):
     guid = ExtendedUUID("522d6f3519204b0fb82ae8f558af2749")
     assert isinstance(format(guid, "base64"), str)
     assert len(format(guid, "base64")) == 22
     assert "=" not in format(guid, "base64"), "Trim padding"
     assert format(guid, "base64") == "Ui1vNRkgSw-4Kuj1WK8nSQ"
 def test_uuid_2_base32(self):
     guid = ExtendedUUID("522d6f3519204b0fb82ae8f558af2749")
     assert isinstance(format(guid, "base32"), str)
     assert len(format(guid, "base32")) == 26
     assert "=" not in format(guid, "base32"), "Trim padding"
     assert format(guid, "base32") == "KIWW6NIZEBFQ7OBK5D2VRLZHJE"