Commit b69d4ce9 authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis

Fix pep8 errors

parent ca385c9a
......@@ -120,6 +120,7 @@ def get_user_mock(request, *args, **kwargs):
"name": "Firstname Lastname"}}
}
@mock.patch("astakosclient.AstakosClient", new=AstakosClientMock)
@mock.patch("snf_django.lib.astakos.get_user", new=get_user_mock)
class HelpdeskTests(TestCase):
......
This diff is collapsed.
......@@ -51,7 +51,7 @@ def override_settings(settings, **kwargs):
>>> from synnefo.util.testing import override_settings
>>> from django.conf import settings
>>> with override_settings(settings, DEBUG=True):
>>> assert settings.DEBUG == True
... assert settings.DEBUG == True
The special arguemnt ``prefix`` can be set to prefix all setting keys with
the provided value.
......@@ -59,11 +59,11 @@ def override_settings(settings, **kwargs):
>>> from django.conf import settings
>>> from django.core import mail
>>> with override_settings(settings, CONTACT_EMAILS=['kpap@grnet.gr'],
>>> prefix='MYAPP_'):
>>> from django.core.mail import send_mail
>>> send_mail("hello", "I love you kpap", settings.DEFAULT_FROM_EMAIL,
>>> settings.MYAPP_CONTACT_EMAILS)
>>> assert 'kpap@grnet.gr' in mail.mailbox[0].recipients()
... prefix='MYAPP_'):
... from django.core.mail import send_mail
... send_mail("hello", "I love you kpap", settings.DEFAULT_FROM_EMAIL,
... settings.MYAPP_CONTACT_EMAILS)
... assert 'kpap@grnet.gr' in mail.mailbox[0].recipients()
If you plan to reuse it
......@@ -71,8 +71,8 @@ def override_settings(settings, **kwargs):
>>> from synnefo.util.testing import override_settings
>>> from django.conf import settings
>>> myapp_settings = functools.partial(override_settings, prefix='MYAPP_')
>>> with myapp_settings(CONTACT_EMAILS=['kpap@grnet.gr'])
>>> assert settings.MYAPP_CONTACT_EMAILS == ['kpap@grnet.gr']
>>> with myapp_settings(CONTACT_EMAILS=['kpap@grnet.gr']):
... assert settings.MYAPP_CONTACT_EMAILS == ['kpap@grnet.gr']
"""
......@@ -134,21 +134,21 @@ def astakos_user(user):
get_token.return_value = "DummyToken"
with patch('astakosclient.AstakosClient.authenticate') as m2:
m2.return_value = {"access": {
"token": {
"expires": "2013-06-19T15:23:59.975572+00:00",
"id": "DummyToken",
"tenant": {
"id": text.udec(user, 'utf8'),
"name": "Firstname Lastname"
}
},
"serviceCatalog": [],
"user": {
"roles_links": [],
"token": {
"expires": "2013-06-19T15:23:59.975572+00:00",
"id": "DummyToken",
"tenant": {
"id": text.udec(user, 'utf8'),
"roles": [{"id": 1, "name": "default"}],
"name": "Firstname Lastname"}}
}
"name": "Firstname Lastname"
}
},
"serviceCatalog": [],
"user": {
"roles_links": [],
"id": text.udec(user, 'utf8'),
"roles": [{"id": 1, "name": "default"}],
"name": "Firstname Lastname"}}
}
with patch('astakosclient.AstakosClient.get_quotas') as m3:
m3.return_value = {
......
......@@ -1897,6 +1897,7 @@ class ObjectPost(PithosAPITest):
HTTP_X_OBJECT_SHARING='write=%s' % (257*'a'))
self.assertEqual(r.status_code, 400)
class ObjectDelete(PithosAPITest):
def setUp(self):
PithosAPITest.setUp(self)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment