Exemplo n.º 1
0
 def test_no_releases_with_files(self):
     # A ValueError is raised if no releases are found.
     # Extraneous files are ignored while looking for releases.
     self.add('hujugui-1.2.3.tgz')  # Wrong prefix.
     self.add('juju-gui-1.2.tgz')  # Missing patch version number.
     self.add('juju-gui-1.2.3.bz2')  # Wrong file extension.
     self.add('juju-gui-1.2.3.4.tgz')  # Wrong version.
     self.add('juju-gui-1.2.3.build.42.tgz')  # Missing "+" separator.
     self.add('juju-gui-1.2.3+built.42.tgz')  # Typo.
     self.add('juju-gui-1.2.3+build.42.47.tgz')  # Invalid revno.
     self.add('juju-gui-1.2.3+build.42.bz2')  # Wrong file extension again.
     with self.mock_releases_dir():
         with self.assert_error():
             print get_release_file_path()
Exemplo n.º 2
0
 def test_no_releases_with_files(self):
     # A ValueError is raised if no releases are found.
     # Extraneous files are ignored while looking for releases.
     self.add("hujugui-1.2.3.tgz")  # Wrong prefix.
     self.add("juju-gui-1.2.tgz")  # Missing patch version number.
     self.add("juju-gui-1.2.3.bz2")  # Wrong file extension.
     self.add("juju-gui-1.2.3.4.tgz")  # Wrong version.
     self.add("juju-gui-1.2.3.build.42.tgz")  # Missing "+" separator.
     self.add("juju-gui-1.2.3+built.42.tgz")  # Typo.
     self.add("juju-gui-1.2.3+build.42.47.tgz")  # Invalid revno.
     self.add("juju-gui-1.2.3+build.42.bz2")  # Wrong file extension again.
     with self.mock_releases_dir():
         with self.assert_error():
             print get_release_file_path()
Exemplo n.º 3
0
 def test_ordering(self):
     # Release versions are correctly ordered.
     self.add("juju-gui-0.12.1.tgz")
     self.add("juju-gui-0.9.1.tgz")
     with self.mock_releases_dir():
         path = get_release_file_path()
     self.assert_path("juju-gui-0.12.1.tgz", path)
Exemplo n.º 4
0
 def test_version_not_found(self):
     # None is returned if the requested version is not found.
     self.add('juju-gui-1.2.3.tgz')
     self.add('juju-GUI-1.42.47.tgz')  # This is not a valid release.
     with self.mock_releases_dir():
         path = get_release_file_path('1.42.47')
     self.assertIsNone(path)
Exemplo n.º 5
0
 def test_ordering(self):
     # Release versions are correctly ordered.
     self.add('juju-gui-0.12.1.tgz')
     self.add('juju-gui-0.9.1.tgz')
     with self.mock_releases_dir():
         path = get_release_file_path()
     self.assert_path('juju-gui-0.12.1.tgz', path)
Exemplo n.º 6
0
 def test_version_not_found(self):
     # None is returned if the requested version is not found.
     self.add("juju-gui-1.2.3.tgz")
     self.add("juju-GUI-1.42.47.tgz")  # This is not a valid release.
     with self.mock_releases_dir():
         path = get_release_file_path("1.42.47")
     self.assertIsNone(path)
Exemplo n.º 7
0
 def test_xz_git_development_version(self):
     # A specific development version is correctly retrieved.
     self.add('juju-gui-1.2.3+build.4247.tgz')
     self.add('juju-gui-2.42.47+build.42b7.xz')
     self.add('juju-gui-2.42.47.tgz')
     self.add('juju-gui-3.42.47+build.4247.tgz')
     with self.mock_releases_dir():
         path = get_release_file_path('2.42.47+build.42b7')
     self.assert_path('juju-gui-2.42.47+build.42b7.xz', path)
Exemplo n.º 8
0
 def test_stable_version(self):
     # A specific stable version is correctly retrieved.
     self.add('juju-gui-1.2.3.tgz')
     self.add('juju-gui-2.0.1+build.42.tgz')
     self.add('juju-gui-2.0.1.tgz')
     self.add('juju-gui-3.2.1.tgz')
     with self.mock_releases_dir():
         path = get_release_file_path('2.0.1')
     self.assert_path('juju-gui-2.0.1.tgz', path)
Exemplo n.º 9
0
 def test_tar_bz2(self):
     # The last release is correctly retrieved for tar.bz2 files too.
     self.add("juju-gui-0.12.1.tgz")
     self.add("juju-gui-1.2.3.tgz")
     self.add("juju-gui-2.0.0+build.42.tgz")
     self.add("jujugui-2.0.1.tar.bz2")
     with self.mock_releases_dir():
         path = get_release_file_path()
     self.assert_path("jujugui-2.0.1.tar.bz2", path)
Exemplo n.º 10
0
 def test_xz(self):
     # The last release is correctly retrieved for xz files too.
     self.add('juju-gui-0.12.1.tgz')
     self.add('juju-gui-1.2.3.tgz')
     self.add('juju-gui-2.0.0+build.42.tgz')
     self.add('juju-gui-2.0.1.xz')
     with self.mock_releases_dir():
         path = get_release_file_path()
     self.assert_path('juju-gui-2.0.1.xz', path)
Exemplo n.º 11
0
 def test_xz_git_development_version(self):
     # A specific development version is correctly retrieved.
     self.add("juju-gui-1.2.3+build.4247.tgz")
     self.add("juju-gui-2.42.47+build.42b7.xz")
     self.add("juju-gui-2.42.47.tgz")
     self.add("juju-gui-3.42.47+build.4247.tgz")
     with self.mock_releases_dir():
         path = get_release_file_path("2.42.47+build.42b7")
     self.assert_path("juju-gui-2.42.47+build.42b7.xz", path)
Exemplo n.º 12
0
 def test_tar_bz2(self):
     # The last release is correctly retrieved for tar.bz2 files too.
     self.add('juju-gui-0.12.1.tgz')
     self.add('juju-gui-1.2.3.tgz')
     self.add('juju-gui-2.0.0+build.42.tgz')
     self.add('jujugui-2.0.1.tar.bz2')
     with self.mock_releases_dir():
         path = get_release_file_path()
     self.assert_path('jujugui-2.0.1.tar.bz2', path)
Exemplo n.º 13
0
 def test_stable_version(self):
     # A specific stable version is correctly retrieved.
     self.add("juju-gui-1.2.3.tgz")
     self.add("juju-gui-2.0.1+build.42.tgz")
     self.add("juju-gui-2.0.1.tgz")
     self.add("juju-gui-3.2.1.tgz")
     with self.mock_releases_dir():
         path = get_release_file_path("2.0.1")
     self.assert_path("juju-gui-2.0.1.tgz", path)
Exemplo n.º 14
0
 def test_xz_git_dev(self):
     # The last release is correctly retrieved.
     self.add('juju-gui-0.12.1.tgz')
     self.add('juju-gui-1.2.3.tgz')
     self.add('juju-gui-2.0.0+build.42.tgz')
     self.add('juju-gui-2.0.1.tgz')
     self.add('juju-gui-2.1.0+build.42a.xz')
     with self.mock_releases_dir():
         path = get_release_file_path()
     self.assert_path('juju-gui-2.1.0+build.42a.xz', path)
Exemplo n.º 15
0
 def test_xz_git_dev(self):
     # The last release is correctly retrieved.
     self.add("juju-gui-0.12.1.tgz")
     self.add("juju-gui-1.2.3.tgz")
     self.add("juju-gui-2.0.0+build.42.tgz")
     self.add("juju-gui-2.0.1.tgz")
     self.add("juju-gui-2.1.0+build.42a.xz")
     with self.mock_releases_dir():
         path = get_release_file_path()
     self.assert_path("juju-gui-2.1.0+build.42a.xz", path)
Exemplo n.º 16
0
 def test_no_releases(self):
     # A ValueError is raised if no releases are found.
     with self.mock_releases_dir():
         with self.assert_error():
             get_release_file_path()
Exemplo n.º 17
0
 def test_no_releases(self):
     # A ValueError is raised if no releases are found.
     with self.mock_releases_dir():
         with self.assert_error():
             get_release_file_path()