From 1623835e91ac71acdb20c92878aedb90c3da4ec4 Mon Sep 17 00:00:00 2001 From: Ziad Sawalha Date: Sat, 30 Apr 2011 13:24:34 -0500 Subject: Annotate TODOs --- test/unit/test_identity.py | 47 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 10 deletions(-) (limited to 'test') diff --git a/test/unit/test_identity.py b/test/unit/test_identity.py index f8dca4a1..5f68e4a4 100644 --- a/test/unit/test_identity.py +++ b/test/unit/test_identity.py @@ -1,16 +1,31 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# Copyright (c) 2010-2011 OpenStack, LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import httplib2 +import json +from lxml import etree import os import sys +from webtest import TestApp +import unittest + # Need to access identity module sys.path.append(os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..', '..', '..', 'keystone'))) from keystone import identity -import unittest -from webtest import TestApp -import httplib2 -import json -from lxml import etree -import unittest -from webtest import TestApp URL = 'http://localhost:8080/v1.0/' @@ -146,7 +161,7 @@ class identity_test(unittest.TestCase): #Given _a_ to make inherited test cases in an order. #here to call below method will call as last test case - def test_a_get_version(self): + def test_get_version_json(self): h = httplib2.Http(".cache") url = URL resp, content = h.request(url, "GET", body="", @@ -154,7 +169,7 @@ class identity_test(unittest.TestCase): self.assertEqual(200, int(resp['status'])) self.assertEqual('application/json', resp['content-type']) - def test_a_get_version(self): + def test_get_version_xml(self): h = httplib2.Http(".cache") url = URL resp, content = h.request(url, "GET", body="", @@ -971,5 +986,17 @@ class delete_tenant_test(tenant_test): self.assertEqual(204, int(resp['status'])) +def setup(): + pass + + +def teardown(): + pass + + if __name__ == '__main__': - unittest.main() + setup() + try: + unittest.main() + finally: + teardown() -- cgit From a0452fe1a376550bddd18987bd6d0d902eb649b4 Mon Sep 17 00:00:00 2001 From: Ziad Sawalha Date: Thu, 5 May 2011 07:50:29 -0500 Subject: Git problems - lingering commit --- test/unit/test_identity.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/unit/test_identity.py b/test/unit/test_identity.py index 5f68e4a4..05e0dd51 100644 --- a/test/unit/test_identity.py +++ b/test/unit/test_identity.py @@ -22,10 +22,10 @@ import sys from webtest import TestApp import unittest -# Need to access identity module +# Need to access server module sys.path.append(os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..', '..', '..', 'keystone'))) -from keystone import identity +from keystone import server URL = 'http://localhost:8080/v1.0/' @@ -156,7 +156,7 @@ def get_disabled_token(): return '999888777' -class identity_test(unittest.TestCase): +class server_test(unittest.TestCase): #Given _a_ to make inherited test cases in an order. #here to call below method will call as last test case @@ -179,7 +179,7 @@ class identity_test(unittest.TestCase): self.assertEqual('application/xml', resp['content-type']) -class authorize_test(identity_test): +class authorize_test(server_test): def setUp(self): self.token = get_token('joeuser', 'secrete', 'token') -- cgit