@@ -0,0 +1,2204 @@
+import unittest%0Afrom collections import OrderedDict%0Afrom copy import deepcopy%0A%0Afrom murpy.compiletools import Environment, RegObj%0A%0A%0Aclass EnvState:%0A    def __init__(self, bfcode=None, pcode=%5B%5D, stackobjs=OrderedDict(),%0A                 regobjs=OrderedDict(), functions=%7B%7D):%0A        # Copy of the default value with list() and dict() here%0A        self._code = bfcode%0A        self.PseudoCode = list(pcode)  # Contenitore delle operazioni da eseguire%0A        self.StackObject = stackobjs  # Container degli StackObj%0A        self.RegistryColl = regobjs  # Container dei RegObj%0A        self.RoutineDict = dict(functions)%0A%0A    def __eq__(self, other):%0A        return self._code == other._code and self.PseudoCode == other.PseudoCode and %5C%0A            self.StackObject == other.StackObject and self.RegistryColl == %5C%0A            other.RegistryColl and self.RoutineDict == other.RoutineDict%0A%0A    @property%0A    def params(self):%0A        return self._code, self.PseudoCode, self.StackObject, self.RegistryColl, %5C%0A            self.RoutineDict%0A%0A    @staticmethod%0A    def getState(env: Environment):%0A        %22%22%22Used for storing the Env state without copying all the Environment%22%22%22%0A        return EnvState(*(deepcopy(x) for x in (env._code, env.PseudoCode, env.StackObject,%0A                                                env.RegistryColl, env.RoutineDict)))%0A%0A    def __repr__(self):%0A        return %22Env(code=%7B%7D,Pcode=%7B%7D,Stack=%7B%7D,Registry=%7B%7D,Routine=%7B%7D)%22.format(%0A            self._code, self.PseudoCode, self.StackObject, self.RegistryColl,%0A            self.RoutineDict )%0A%0A%0Aclass MyTestCase(unittest.TestCase):%0A    def setUp(self):%0A        self.env = Environment()%0A%0A    def test_RequestRegistry(self):%0A        state0 = EnvState.getState(self.env)%0A        regobj = self.env.RequestRegistry()%0A        state1 = EnvState.getState(self.env)%0A        for i in (0, 1, 2, 4):%0A            self.assertEqual(state0.params%5Bi%5D,state1.params%5Bi%5D)%0A        self.assertNotEqual(state0.params%5B3%5D, state1.params%5B3%5D)%0A        self.assertEqual(%5Bx for x in state1.params%5B3%5D.values() %5C%0A                          if x not in state0.params%5B3%5D.values()%5D, %5Bregobj%5D)%0A%0A    # TODO: Continue Unittesting%0A%0Aif __name__ == '__main__':%0A    unittest.main()%0A

Add unittest for Environment