diff options
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/hashserv/sqlite.py | 17 | ||||
-rw-r--r-- | bitbake/lib/toaster/tests/functional/test_create_new_project.py | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/bitbake/lib/hashserv/sqlite.py b/bitbake/lib/hashserv/sqlite.py index da2e844a03..976504d7f4 100644 --- a/bitbake/lib/hashserv/sqlite.py +++ b/bitbake/lib/hashserv/sqlite.py | |||
@@ -4,6 +4,7 @@ | |||
4 | # | 4 | # |
5 | # SPDX-License-Identifier: GPL-2.0-only | 5 | # SPDX-License-Identifier: GPL-2.0-only |
6 | # | 6 | # |
7 | from datetime import datetime, timezone | ||
7 | import sqlite3 | 8 | import sqlite3 |
8 | import logging | 9 | import logging |
9 | from contextlib import closing | 10 | from contextlib import closing |
@@ -53,6 +54,22 @@ CONFIG_TABLE_DEFINITION = ( | |||
53 | CONFIG_TABLE_COLUMNS = tuple(name for name, _, _ in CONFIG_TABLE_DEFINITION) | 54 | CONFIG_TABLE_COLUMNS = tuple(name for name, _, _ in CONFIG_TABLE_DEFINITION) |
54 | 55 | ||
55 | 56 | ||
57 | def adapt_datetime_iso(val): | ||
58 | """Adapt datetime.datetime to UTC ISO 8601 date.""" | ||
59 | return val.astimezone(timezone.utc).isoformat() | ||
60 | |||
61 | |||
62 | sqlite3.register_adapter(datetime, adapt_datetime_iso) | ||
63 | |||
64 | |||
65 | def convert_datetime(val): | ||
66 | """Convert ISO 8601 datetime to datetime.datetime object.""" | ||
67 | return datetime.fromisoformat(val.decode()) | ||
68 | |||
69 | |||
70 | sqlite3.register_converter("DATETIME", convert_datetime) | ||
71 | |||
72 | |||
56 | def _make_table(cursor, name, definition): | 73 | def _make_table(cursor, name, definition): |
57 | cursor.execute( | 74 | cursor.execute( |
58 | """ | 75 | """ |
diff --git a/bitbake/lib/toaster/tests/functional/test_create_new_project.py b/bitbake/lib/toaster/tests/functional/test_create_new_project.py index 51c8c12037..66213c736e 100644 --- a/bitbake/lib/toaster/tests/functional/test_create_new_project.py +++ b/bitbake/lib/toaster/tests/functional/test_create_new_project.py | |||
@@ -53,7 +53,7 @@ class TestCreateNewProject(SeleniumFunctionalTestCase): | |||
53 | - Release: Yocto Project 4.0 "Kirkstone" (option value: 6) | 53 | - Release: Yocto Project 4.0 "Kirkstone" (option value: 6) |
54 | - Merge Toaster settings: True | 54 | - Merge Toaster settings: True |
55 | """ | 55 | """ |
56 | release = '6' | 56 | release = '7' |
57 | release_title = 'Yocto Project 4.0 "Kirkstone"' | 57 | release_title = 'Yocto Project 4.0 "Kirkstone"' |
58 | project_name = 'projectkirkstone' | 58 | project_name = 'projectkirkstone' |
59 | self.create_new_project( | 59 | self.create_new_project( |