'Exercise most branches of letsencrypt-auto.
They just happen to be the branches in which everything goes well.
I violate my usual rule of having small, decoupled tests, because...
1. We shouldn\'t need to run a Cartesian product of the branches: the
phases run in separate shell processes, containing state leakage
pretty effectively. The only shared state is FS state, and it\'s
limited to a temp dir, assuming (if we dare) all functions properly.
2. One combination of branches happens to set us up nicely for testing
the next, saving code.'

def test_successes(self):

    NEW_LE_AUTO = build_le_auto(version='99.9.9', requirements='letsencrypt==99.9.9    --hash=sha256:1cc14d61ab424cdee446f51e50f1123f8482ec740587fe78626c933bba2873a0')
    NEW_LE_AUTO_SIG = signed(NEW_LE_AUTO)
    with ephemeral_dir() as venv_dir:
        resources = {'certbot/json': dumps({'releases': {'99.9.9': None}}), 'v99.9.9/letsencrypt-auto': NEW_LE_AUTO, 'v99.9.9/letsencrypt-auto.sig': NEW_LE_AUTO_SIG}
        with serving(resources) as base_url:
            run_letsencrypt_auto = partial(run_le_auto, venv_dir, base_url, PIP_FIND_LINKS=join(tests_dir(), 'fake-letsencrypt', 'dist'))
            install_le_auto(build_le_auto(version='50.0.0'), venv_dir)
            (out, err) = run_letsencrypt_auto()
            ok_(re.match('letsencrypt    \\d+\\.\\d+\\.\\d+', err.strip().splitlines()[(-1)]))
            self.assertTrue(('Upgrading    certbot-auto    ' in out))
            self.assertTrue(('Creating    virtual    environment...' in out))
            (out, err) = run_letsencrypt_auto()
            self.assertFalse(('Upgrading    certbot-auto    ' in out))
            self.assertFalse(('Creating    virtual    environment...' in out))
            set_le_script_version(venv_dir, '0.0.1')
            (out, err) = run_letsencrypt_auto()
            self.assertFalse(('Upgrading    certbot-auto    ' in out))
            self.assertTrue(('Creating    virtual    environment...' in out))
