def rmttest_neg_01(self):
        """NormalizeDependencies: is result is correctly handled: Exception"""
        global myexit_called
        myexit_called = False
        global myexit_val
        myexit_val = None

        def myexit(n):
            global myexit_called
            myexit_called = True
            global myexit_val
            myexit_val = n

        def mymain(args, mstdout, mstderr):
            raise RMTException(63, "test thingy")

        main_impl(None, None, sys.stderr, mymain, myexit)
        assert myexit_called
        assert 1 == myexit_val
    def rmttest_neg_01(self):
        """NormalizeDependencies: is result is correctly handled: Exception"""
        global myexit_called
        myexit_called = False
        global myexit_val
        myexit_val = None

        def myexit(n):
            global myexit_called
            myexit_called = True
            global myexit_val
            myexit_val = n

        def mymain(args, mstdout, mstderr):
            raise RMTException(63, "test thingy")

        main_impl(None, None, sys.stderr, mymain, myexit)
        assert myexit_called
        assert 1 == myexit_val
Ejemplo n.º 3
0
    def rmttest_pos_01(self):
        "Normalization test"

        def myexit(n):
            self.rval = n

        os.environ["basedir"] = mdir
        mout, merr = prepare_result_is_dir()
        td = tmp_dir()

        # Copy requirements to tmp dir
        destdir = os.path.join(td, "reqs")
        shutil.copytree("%s/input/reqs" % mdir, destdir,
                        ignore=shutil.ignore_patterns('*~',))

        # Call the converter
        main_impl(["-j", "file://" + mdir + "/input/Config.json"],
                  mout, merr, main_func, myexit)
        assert 0 == self.rval
        cleanup_std_log(mout, merr)
        check_file_results(mdir)
        delete_result_is_dir()
Ejemplo n.º 4
0
    def rmttest_pos_01(self):
        "Normalization test"

        def myexit(n):
            self.rval = n

        os.environ["basedir"] = mdir
        mout, merr = prepare_result_is_dir()
        td = tmp_dir()

        # Copy requirements to tmp dir
        destdir = os.path.join(td, "reqs")
        shutil.copytree("%s/input/reqs" % mdir, destdir,
                        ignore=shutil.ignore_patterns('*~',))

        # Call the converter
        main_impl(["-j", "file://" + mdir + "/input/Config.json"],
                  mout, merr, main_func, myexit)
        assert 0 == self.rval
        cleanup_std_log(mout, merr)
        check_file_results(mdir)
        delete_result_is_dir()