コード例 #1
0
ファイル: test_images.py プロジェクト: trevenen/crane
 def test_repo_url_with_trailing_slash(self):
     result = images.get_image_file_url('abc123', 'ancestry')
     expected = 'http://cdn.redhat.com/foo/bar/images/abc123/ancestry'
     self.assertEquals(result, expected)
コード例 #2
0
ファイル: test_images.py プロジェクト: trevenen/crane
 def test_invalid_image_id(self):
     with self.assertRaises(exceptions.HTTPError) as assertion:
         images.get_image_file_url('bad_image_id', 'ancestry')
     self.assertEqual(assertion.exception.status_code, httplib.NOT_FOUND)
コード例 #3
0
ファイル: test_images.py プロジェクト: trevenen/crane
 def test_repo_url_missing_trailing_slash(self):
     result = images.get_image_file_url('def456', 'ancestry')
     expected = 'http://cdn.redhat.com/bar/baz/images/def456/ancestry'
     self.assertEquals(result, expected)
コード例 #4
0
ファイル: test_images.py プロジェクト: trevenen/crane
 def test_invalid_filename(self):
     with self.assertRaises(exceptions.HTTPError) as assertion:
         images.get_image_file_url('def456', 'foo')
     self.assertEqual(assertion.exception.status_code, httplib.NOT_FOUND)
コード例 #5
0
ファイル: test_images.py プロジェクト: aprajshekhar/crane
 def test_repo_url_with_trailing_slash(self):
     result = images.get_image_file_url('abc123', 'ancestry')
     expected = 'http://cdn.redhat.com/foo/bar/images/abc123/ancestry'
     self.assertEquals(result, expected)
コード例 #6
0
ファイル: test_images.py プロジェクト: aprajshekhar/crane
 def test_repo_url_missing_trailing_slash(self):
     result = images.get_image_file_url('def456', 'ancestry')
     expected = 'http://cdn.redhat.com/bar/baz/images/def456/ancestry'
     self.assertEquals(result, expected)
コード例 #7
0
ファイル: test_images.py プロジェクト: aprajshekhar/crane
 def test_invalid_image_id(self):
     with self.assertRaises(exceptions.HTTPError) as assertion:
         images.get_image_file_url('bad_image_id', 'ancestry')
     self.assertEqual(assertion.exception.status_code, httplib.NOT_FOUND)
コード例 #8
0
ファイル: test_images.py プロジェクト: aprajshekhar/crane
 def test_invalid_filename(self):
     with self.assertRaises(exceptions.HTTPError) as assertion:
         images.get_image_file_url('def456', 'foo')
     self.assertEqual(assertion.exception.status_code, httplib.NOT_FOUND)