2019-02-05 12:45:09 +02:00
|
|
|
#
|
|
|
|
# Ethereum KeyFile
|
|
|
|
# (c) Copyright 2018
|
|
|
|
# Status Research & Development GmbH
|
|
|
|
#
|
|
|
|
# Licensed under either of
|
|
|
|
# Apache License, version 2.0, (LICENSE-APACHEv2)
|
|
|
|
# MIT license (LICENSE-MIT)
|
|
|
|
|
2020-04-27 15:16:11 +02:00
|
|
|
{.used.}
|
|
|
|
|
2021-04-06 13:33:24 +02:00
|
|
|
import
|
2021-12-11 19:12:55 +01:00
|
|
|
unittest2,
|
2021-04-06 13:33:24 +02:00
|
|
|
../../eth/keyfile/uuid
|
2019-02-05 12:45:09 +02:00
|
|
|
|
|
|
|
suite "Cross-platform UUID test suite":
|
|
|
|
test "Platform UUID check":
|
2020-04-06 18:24:15 +02:00
|
|
|
check uuidGenerate().isOk
|
|
|
|
|
2019-02-05 12:45:09 +02:00
|
|
|
test "Conversion test":
|
2020-04-06 18:24:15 +02:00
|
|
|
let u = uuidGenerate()[]
|
2019-02-05 12:45:09 +02:00
|
|
|
check:
|
|
|
|
len($u) == 36
|
2020-04-06 18:24:15 +02:00
|
|
|
$uuidFromString($u)[] == $u
|
|
|
|
uuidToString(u) == $u
|