~ntt-pf-lab/nova/monkey_patch_notification

« back to all changes in this revision

Viewing changes to nova/tests/api/openstack/test_common.py

  • Committer: Lvov Maxim
  • Date: 2011-07-26 05:50:05 UTC
  • mfrom: (1320 nova)
  • mto: This revision was merged to the branch mainline in revision 1322.
  • Revision ID: usrleon@gmail.com-20110726055005-7olsp0giqup3pao7
merge with trunk, resolve conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
247
247
        self.assertRaises(ValueError,
248
248
                          common.get_id_from_href,
249
249
                          fixture)
 
250
 
 
251
    def test_get_version_from_href(self):
 
252
        fixture = 'http://www.testsite.com/v1.1/images'
 
253
        expected = '1.1'
 
254
        actual = common.get_version_from_href(fixture)
 
255
        self.assertEqual(actual, expected)
 
256
 
 
257
    def test_get_version_from_href_2(self):
 
258
        fixture = 'http://www.testsite.com/v1.1'
 
259
        expected = '1.1'
 
260
        actual = common.get_version_from_href(fixture)
 
261
        self.assertEqual(actual, expected)
 
262
 
 
263
    def test_get_version_from_href_default(self):
 
264
        fixture = 'http://www.testsite.com/images'
 
265
        expected = '1.0'
 
266
        actual = common.get_version_from_href(fixture)
 
267
        self.assertEqual(actual, expected)