<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/openstack/python-swiftclient.git/tests/unit/test_swiftclient.py, branch stable/juno</title>
<subtitle>opendev.org: openstack/python-swiftclient.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/'/>
<entry>
<title>Fix bug with some OS options not being passed to client</title>
<updated>2014-09-24T17:19:12+00:00</updated>
<author>
<name>Alistair Coles</name>
<email>alistair.coles@hp.com</email>
</author>
<published>2014-09-22T10:52:44+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=f90d7f28e504be045e59b395aee0abc057417f8f'/>
<id>f90d7f28e504be045e59b395aee0abc057417f8f</id>
<content type='text'>
Fixes a regression that is preventing swiftclient from
authenticating using keystone v3 options.

swiftclient/shell.py processes the dict of command
line options to set up a child dict ('os_options')
of keystone auth specific options (line 960). The
processing includes stripping --os- prefixes from
the command line options before adding keys to
os_options.

A recent patch https://review.openstack.org/#/c/85453/
introduced a duplication of this option processing
in service.py (line 79) which replaces the os_options
created in shell.py, but omits keystone v3 related
options. Consequently the keystone v3 options are
not being passed to the client get_auth() method.

This patch adds the keystone v3 related options to
the option processing in service.py.

For pragmatic reasons (i.e. fixing the bug quickly)
the option processing code has not been removed from
parse_args in shell.py. It is likely that the code in
parse_args is now redundant, but all code paths between
parse_args and process_options should be inspected and
test coverage added before removing that code.

Unit tests have been added in test_shell.py to verify
that command line options are correctly passed to the
client get_auth method.

The MockHttpTest class is re-used in test_shell.py,
so it is moved from test_swiftclient.py
to tests/unit/utils.py

Closes-bug: #1372465

Change-Id: I4fed013cdb8936509609d06093337cc147ade0d6
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes a regression that is preventing swiftclient from
authenticating using keystone v3 options.

swiftclient/shell.py processes the dict of command
line options to set up a child dict ('os_options')
of keystone auth specific options (line 960). The
processing includes stripping --os- prefixes from
the command line options before adding keys to
os_options.

A recent patch https://review.openstack.org/#/c/85453/
introduced a duplication of this option processing
in service.py (line 79) which replaces the os_options
created in shell.py, but omits keystone v3 related
options. Consequently the keystone v3 options are
not being passed to the client get_auth() method.

This patch adds the keystone v3 related options to
the option processing in service.py.

For pragmatic reasons (i.e. fixing the bug quickly)
the option processing code has not been removed from
parse_args in shell.py. It is likely that the code in
parse_args is now redundant, but all code paths between
parse_args and process_options should be inspected and
test coverage added before removing that code.

Unit tests have been added in test_shell.py to verify
that command line options are correctly passed to the
client get_auth method.

The MockHttpTest class is re-used in test_shell.py,
so it is moved from test_swiftclient.py
to tests/unit/utils.py

Closes-bug: #1372465

Change-Id: I4fed013cdb8936509609d06093337cc147ade0d6
</pre>
</div>
</content>
</entry>
<entry>
<title>Add keystone v3 auth support</title>
<updated>2014-07-23T15:55:38+00:00</updated>
<author>
<name>anc</name>
<email>alistair.coles@hp.com</email>
</author>
<published>2014-03-25T08:21:21+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=cae12940b1bff230381289b732b464d88423fec1'/>
<id>cae12940b1bff230381289b732b464d88423fec1</id>
<content type='text'>
Enables swiftclient to authenticate using
the keystone v3 API, allowing user id's, user
domains and tenant/project domains to be
specified.

Since swiftclient imports keystoneclient, the
main changes in swiftclient/client.py are to
selectively import the correct keystoneclient
library version and pass a number of new
options to it via the get_auth() function. In
addition the get_keystoneclient_2_0 method
has been renamed get_auth_keystone to better
reflect its purpose since it now deals with
both v2 and v3 use cases.

In swiftclient/shell.py the new options are
added to the parser. To make the default help
message shorter, help for all the --os-*
options (including the existing v2 options)
is only displayed when explicitly requested
usng a new --os-help option.

A new set of unit tests is added to
test_shell.py to verify the parser. A comment
in tests/sample.conf explains how to
configure the existing functional tests to
run using keystone v3 API.

Note that to use keystone v3
with swift you will need to set
auth_version = v3.0 in the auth_token
middleware config section of
proxy-server.conf.

Change-Id: Ifda0b3263eb919a8c6a1b204ba0a1215ed6f642f
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Enables swiftclient to authenticate using
the keystone v3 API, allowing user id's, user
domains and tenant/project domains to be
specified.

Since swiftclient imports keystoneclient, the
main changes in swiftclient/client.py are to
selectively import the correct keystoneclient
library version and pass a number of new
options to it via the get_auth() function. In
addition the get_keystoneclient_2_0 method
has been renamed get_auth_keystone to better
reflect its purpose since it now deals with
both v2 and v3 use cases.

In swiftclient/shell.py the new options are
added to the parser. To make the default help
message shorter, help for all the --os-*
options (including the existing v2 options)
is only displayed when explicitly requested
usng a new --os-help option.

A new set of unit tests is added to
test_shell.py to verify the parser. A comment
in tests/sample.conf explains how to
configure the existing functional tests to
run using keystone v3 API.

Note that to use keystone v3
with swift you will need to set
auth_version = v3.0 in the auth_token
middleware config section of
proxy-server.conf.

Change-Id: Ifda0b3263eb919a8c6a1b204ba0a1215ed6f642f
</pre>
</div>
</content>
</entry>
<entry>
<title>Relax requirement for tenant_name in get_auth()</title>
<updated>2014-06-05T17:02:52+00:00</updated>
<author>
<name>anc</name>
<email>alistair.coles@hp.com</email>
</author>
<published>2014-05-20T12:35:03+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=916f5cbd61eac86527b7a9b867ea1ddb3c84cdf5'/>
<id>916f5cbd61eac86527b7a9b867ea1ddb3c84cdf5</id>
<content type='text'>
get_auth() in client.py raises an exception if
tenant_name is not included in the os_options
dict. This is overly constrained since tenant_id
is equally sufficient. This patch modifies
get_auth to require either tenant_name
or tenant_id.

Change-Id: Ibbcda1704637eb887efa5895579d260a1e072327
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
get_auth() in client.py raises an exception if
tenant_name is not included in the os_options
dict. This is overly constrained since tenant_id
is equally sufficient. This patch modifies
get_auth to require either tenant_name
or tenant_id.

Change-Id: Ibbcda1704637eb887efa5895579d260a1e072327
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge "change assertEquals to assertEqual"</title>
<updated>2014-05-28T03:23:20+00:00</updated>
<author>
<name>Jenkins</name>
<email>jenkins@review.openstack.org</email>
</author>
<published>2014-05-28T03:23:20+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=3d0de79e26e2aa6285742c60aca3c164e9c2fbb9'/>
<id>3d0de79e26e2aa6285742c60aca3c164e9c2fbb9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge "Remove testtools.main() call from tests"</title>
<updated>2014-05-24T09:16:59+00:00</updated>
<author>
<name>Jenkins</name>
<email>jenkins@review.openstack.org</email>
</author>
<published>2014-05-24T09:16:59+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=5e18d95cb297adaa6f9658241e6dca179ef9ab8d'/>
<id>5e18d95cb297adaa6f9658241e6dca179ef9ab8d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix wrong assertions in unit tests</title>
<updated>2014-05-22T15:56:31+00:00</updated>
<author>
<name>anc</name>
<email>alistair.coles@hp.com</email>
</author>
<published>2014-05-22T15:56:31+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=eaf4fcbb8d00e9e974c9408e550154fa3cfeefea'/>
<id>eaf4fcbb8d00e9e974c9408e550154fa3cfeefea</id>
<content type='text'>
A couple of assertTrue in the test_swiftclient.py
unit tests should be assertEqual. Also, the expected
values now need to be bytes literals.

Change-Id: I7cc1bd60d9ba82d1a28fbae2e1243d3c799451bd
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A couple of assertTrue in the test_swiftclient.py
unit tests should be assertEqual. Also, the expected
values now need to be bytes literals.

Change-Id: I7cc1bd60d9ba82d1a28fbae2e1243d3c799451bd
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Python3 bugs</title>
<updated>2014-05-21T13:54:18+00:00</updated>
<author>
<name>Christian Schwede</name>
<email>christian.schwede@enovance.com</email>
</author>
<published>2014-05-20T11:41:03+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=258420f41049d92fc0b59b9263c8381bfe513432'/>
<id>258420f41049d92fc0b59b9263c8381bfe513432</id>
<content type='text'>
This patch fixes three issues that were found running
functional tests with Python 3:

1. python-requests sets 'application/x-www-form-urlencoded' as
   content-type if the input is not a string object and no
   content-type is given.

2. Encoding of the headers is now only done if required. This
   prevents comparisons between unencoded headers and encoded
   prefixes and avoids unnecessary forloop-iterations.
   One unittest was extended to ensure it works for unencoded
   and encoded headers with or without the prefix.

3. Functional tests recently switched to using byte data for
   testing, thus the comparison needs to be a byte object as well.

Change-Id: I035f8b4b9c9ccdc79820b907770a48f86d0343b4
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes three issues that were found running
functional tests with Python 3:

1. python-requests sets 'application/x-www-form-urlencoded' as
   content-type if the input is not a string object and no
   content-type is given.

2. Encoding of the headers is now only done if required. This
   prevents comparisons between unencoded headers and encoded
   prefixes and avoids unnecessary forloop-iterations.
   One unittest was extended to ensure it works for unencoded
   and encoded headers with or without the prefix.

3. Functional tests recently switched to using byte data for
   testing, thus the comparison needs to be a byte object as well.

Change-Id: I035f8b4b9c9ccdc79820b907770a48f86d0343b4
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove testtools.main() call from tests</title>
<updated>2014-05-20T14:54:41+00:00</updated>
<author>
<name>Christian Schwede</name>
<email>christian.schwede@enovance.com</email>
</author>
<published>2014-05-20T14:49:49+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=876238a134d6f0332eeea57e03c3858b452895a1'/>
<id>876238a134d6f0332eeea57e03c3858b452895a1</id>
<content type='text'>
There is no testtools.main() at all (this was a
unittest.main() before). Let's remove this unused
and non-working code.

The following code can be used if someone needs
to start tests manually:

    python -m unittest &lt;test_file.py&gt;

Change-Id: Id5162ac73825584df6c23dbe68786ff3355fc6ae
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is no testtools.main() at all (this was a
unittest.main() before). Let's remove this unused
and non-working code.

The following code can be used if someone needs
to start tests manually:

    python -m unittest &lt;test_file.py&gt;

Change-Id: Id5162ac73825584df6c23dbe68786ff3355fc6ae
</pre>
</div>
</content>
</entry>
<entry>
<title>change assert_ to assertTrue</title>
<updated>2014-05-14T19:15:07+00:00</updated>
<author>
<name>Christian Berendt</name>
<email>berendt@b1-systems.de</email>
</author>
<published>2014-05-14T19:15:07+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=f58a1640a1e163cf97d40bf2c6efc071b310aaa4'/>
<id>f58a1640a1e163cf97d40bf2c6efc071b310aaa4</id>
<content type='text'>
According to http://docs.python.org/2/library/unittest.html
assert_ is a deprecated alias of assertTrue.

Change-Id: I18db0af72934dde4498502fb29579941d020cf01
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to http://docs.python.org/2/library/unittest.html
assert_ is a deprecated alias of assertTrue.

Change-Id: I18db0af72934dde4498502fb29579941d020cf01
</pre>
</div>
</content>
</entry>
<entry>
<title>change assertEquals to assertEqual</title>
<updated>2014-05-14T17:08:52+00:00</updated>
<author>
<name>Christian Berendt</name>
<email>berendt@b1-systems.de</email>
</author>
<published>2014-05-14T17:08:31+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=569bbc723ec761efc8d5b32f84e2cb4dccb2b3a7'/>
<id>569bbc723ec761efc8d5b32f84e2cb4dccb2b3a7</id>
<content type='text'>
According to http://docs.python.org/2/library/unittest.html
assertEquals is a deprecated alias of assertEqual.

Change-Id: Ibf4d548b86c53f30830b7e34b019fa8f67997cd8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to http://docs.python.org/2/library/unittest.html
assertEquals is a deprecated alias of assertEqual.

Change-Id: Ibf4d548b86c53f30830b7e34b019fa8f67997cd8
</pre>
</div>
</content>
</entry>
</feed>
