Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.

0 downloads

dbbasic-object-server/tests/test_object_ids.py
Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic-object-server.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic-object-server.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic-object-server.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

danq9 signup: the person chooses the password and name on the confirm page 83c7aa6 2 weeks, 5 days ago History
test_object_ids.py · 672 bytes · 22 lines
1from uuid import UUID
2
3import object_ids
4
5
6def test_new_uuid4_returns_canonical_uuid4_string():
7 value = object_ids.new_uuid4()
8
9 parsed = UUID(value)
10 assert parsed.version == 4
11 assert str(parsed) == value
12
13
14def test_normalize_uuid4_accepts_only_uuid4_values():
15 value = object_ids.new_uuid4()
16
17 assert object_ids.normalize_uuid4(value.upper()) == value
18 assert object_ids.normalize_uuid4("00000000-0000-0000-0000-000000000000") is None
19 assert object_ids.normalize_uuid4("not-a-uuid") is None
20 assert object_ids.normalize_uuid4(None) is None
21 assert object_ids.is_uuid4(value) is True
22 assert object_ids.is_uuid4("not-a-uuid") is False