diff options
author | Roman Podolyaka <rpodolyaka@mirantis.com> | 2013-07-11 11:52:52 +0300 |
---|---|---|
committer | Roman Podolyaka <rpodolyaka@mirantis.com> | 2013-07-19 16:08:54 +0300 |
commit | 2e83be17d101c1501795708a9acc4671dee9c02d (patch) | |
tree | 5a0e4640e11091ac986962e5b8cb5f4a40b8460b /HACKING.rst | |
parent | 3b517c3d5a9388136822942a674b1b337ca5579b (diff) | |
download | nova-2e83be17d101c1501795708a9acc4671dee9c02d.tar.gz |
Use timeutils.utcnow() throughout the code
timeutils.utcnow() should be used instead of direct calls to
datetime.datetime.utcnow() to make it easy to override its return
value in tests.
Add a hacking rule to prevent regressions.
Fixes bug 1200141.
Change-Id: I170dbd7c9093bd627e2a0d5984b7ad1bf105c8d5
Diffstat (limited to 'HACKING.rst')
-rw-r--r-- | HACKING.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/HACKING.rst b/HACKING.rst index dcf71e4537..82a7a08f0c 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -11,6 +11,8 @@ Nova Specific Commandments - ``nova.db`` imports are not allowed in ``nova/virt/*`` - [N309] no db session in public API methods (disabled) This enforces a guideline defined in ``nova.openstack.common.db.sqlalchemy.session`` +- [N310] timeutils.utcnow() wrapper must be used instead of direct calls to + datetime.datetime.utcnow() to make it easy to override its return value in tests Creating Unit Tests ------------------- |