Add auth_uri in conf to avoid unnecessary warning

Unittest code for auth_token.py doesn't specify auth_uri in conf,
which will cause lots of warnings, since auth_token.py will use
'%(protocol)s://%(host)s:%(port)s' to generate auth_uri when it is
None, we can specify this value directly to avoid unnecessary warnings.

Closes-Bug: #1219493
Change-Id: I26b636bcddabd91b06479c6a42a6a48d74ac9431
Fixes print error for keystone action with non-English characters

When processing keystone tenant-delete action with non-English
characters, printing the exception traceback will result in a
UnicodeEncodeError, so should encode text with safe_encode.

Fixes bug #1231472

Change-Id: Ic2599c51513189c132e31aa87d0d15df81802688
Refactor for testability of an upcoming change

confirm_token_not_expired() in keystoneclient/middleware/auth_token.py has
been moved out of the class to make it a function and be more testable.
Currently, there is no need to keep it within the class. An upcoming
commit makes fixes that rely on this refactor to be tested.

Change-Id: I8460a2ee663dec8be0f339735208779a3b988040
Fix H202 assertRaises Exception

Align the hacking version between test-requirement and global requirement.

The change of H202 detection from 0.6 to 0.7 in hacking is:

-    if logical_line.startswith("self.assertRaises(Exception)"):
+    if logical_line.startswith("self.assertRaises(Exception,"):

then more cases are detected by this change. Fix the exposed H202 error.

There is a special test case:
tests/v3/test_endpoints.py:test_update_invalid_interface

ref = self.new_ref(interface=uuid.uuid4().hex)

this line can not generate proper parameter for self.manager.update,
add a parameter "endpoint" for it, according to the
definition in keystoneclient/v3/endpoints.py:EndpointManager.update.

Otherwise, there will be following error after changing the Exception
to exceptions.ValidationError:
TypeError: update() takes at least 2 arguments (6 given)

Fixes Bug #1220008

Change-Id: I8f7ed7a6eebf8576a6db5fecd86b9d19a15c8d60
Merge "Add auth_uri in conf to avoid unnecessary warning"
Merge "Refactor for testability of an upcoming change"
assertEquals is deprecated, use assertEqual (H602)

Change-Id: Iefd087320659909b89864018ccb4ccf50a75aff6
Normalize datetimes to account for tz

This patch makes sure that datetimes in the auth_token middleware
are normalized to account for timezone offsets.

Some of the old tests were changed to ensure that the expires string
stored in the cache is in ISO 8601 format and not a random float.

Fixes bug 1195924

Change-Id: I5917ab728193cd2aa8784c4860a96cdc17f3d43f
Merge "Fix H202 assertRaises Exception"
Merge "Normalize datetimes to account for tz"
Merge "assertEquals is deprecated, use assertEqual (H602)"
Merge "Fixes print error for keystone action with non-English characters"