~raxnetworking/nova/melange

« back to all changes in this revision

Viewing changes to melange/tests/unit/test_versions.py

  • Committer: Rajaram Mallya
  • Date: 2011-09-05 13:19:18 UTC
  • Revision ID: rajarammallya@gmail.com-20110905131918-impvi6rmge75qk1x
Rajaram/Vinkesh|fixed more imports to import  only modules and misc style improvements

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
15
#    License for the specific language governing permissions and limitations
16
16
#    under the License.
17
 
from webtest import TestApp
 
17
 
 
18
import webtest
18
19
 
19
20
from melange.common import config
20
 
from melange.tests import BaseTest
21
 
from melange.tests.unit import test_config_path
22
 
 
23
 
 
24
 
class TestVersionsController(BaseTest):
 
21
from melange import tests
 
22
from melange.tests import unit
 
23
 
 
24
 
 
25
class TestVersionsController(tests.BaseTest):
25
26
 
26
27
    def setUp(self):
27
28
        conf, melange_app = config.load_paste_app('versioned_melange',
28
 
                                     {"config_file": test_config_path()}, None)
29
 
        self.test_app = TestApp(melange_app)
 
29
                              {"config_file": unit.test_config_path()}, None)
 
30
        self.test_app = webtest.TestApp(melange_app)
30
31
        super(TestVersionsController, self).setUp()
31
32
 
32
33
    def test_versions_index(self):
33
34
        response = self.test_app.get("/")
34
35
        link = [{'href': "http://localhost/v0.1", 'rel': 'self'}]
35
36
        self.assertEqual(response.json, {'versions':
36
 
                         [{'status':'CURRENT',
37
 
                           'name': 'v0.1', 'links': link}]})
 
37
                                         [{
 
38
                                             'status':'CURRENT',
 
39
                                             'name': 'v0.1',
 
40
                                             'links': link,
 
41
                                             }]
 
42
                                         })
38
43
 
39
44
    def test_versions_index_for_xml(self):
40
45
        response = self.test_app.get("/",