Example #1
0
    def test_neg_02(self):
        "ReqsContinuum: check exception when vcs is needed but not available \
        (entry point in execute_cmds())"

        tdir = tempfile.mkdtemp(prefix="rmtoo-tst-ctnt-")

        class Config:
            reqs_spec = {"commit_interval": ["v1", "v7"],
                         "directory": tdir }

        mstderr = StringIO.StringIO()

        rval = execute_cmds(None, Config, None, None, mstderr)

        assert(rval==False)
        assert(mstderr.getvalue()=="+++ ERROR: Problem reading in "
               "the continuum: '[  40]: Based on the config '['v1', 'v7']' "
               "a repository is needed - but there is none'")
Example #2
0
    def test_neg_02(self):
        "ReqsContinuum: check exception when vcs is needed but not available \
        (entry point in execute_cmds())"

        tdir = tempfile.mkdtemp(prefix="rmtoo-tst-ctnt-")

        config = Cfg()
        config.set_value('requirements.input.commit_interval.begin', 'v1')
        config.set_value('requirements.input.commit_interval.end', 'v7')
        config.set_value('requirements.input.directory', tdir)

        mstderr = StringIO.StringIO()

        rval = execute_cmds(config, None, None, mstderr)

        assert(rval == False)
        print("ERROR IS [%s]" % mstderr.getvalue())
        assert(mstderr.getvalue() == "+++ ERROR: Problem reading in "
               "the continuum: '[  40]: Based on the config "
               "a repository is needed - but there is none'")