Exemplo n.º 1
0
def test_valid_releases(httpserver, info):
    """Valid releases"""
    with fakeresponse(httpserver, DATA_JSON, HTTP_HEADERS_JSON):
        releases = update.get_valid_releases(TEST_REPO_SLUG)
        # Correct number of releases
        assert len(releases) == 3

        # Invalid releases are not in the list
        versions = [d['version'] for d in releases]
        for v in RELEASES_INVALID:
            assert v not in versions

        # Correct latest release
        assert update.Version(releases[0]['version']) == \
            update.Version(RELEASE_LATEST)
Exemplo n.º 2
0
    def test_valid_releases(self):
        """Update: valid releases"""

        releases = update.get_valid_releases(TEST_REPO_SLUG)

        # Right number of valid releases
        self.assertEquals(len(releases), 3)

        # Invalid releases are not in list
        versions = [d['version'] for d in releases]
        for v in RELEASES_INVALID:
            self.assertFalse(v in versions)

        # Correct latest release
        self.assertEquals(update.Version(releases[0]['version']),
                          update.Version(RELEASE_LATEST))