def testGetValue(self):
		"""
		Tests :meth:`foundations.environment.Environment.getValue` method.
		"""

		if platform.system() == "Windows" or platform.system() == "Microsoft":
			environment = Environment("APPDATA")
		elif platform.system() == "Darwin":
			environment = Environment("HOME")
		elif platform.system() == "Linux":
			environment = Environment("HOME")
		self.assertTrue(environment.getValue())
		self.assertIsInstance(environment.getValue(), unicode)
		environment.setValues(JOHN="DOE")
		self.assertEqual(environment.getValue("JOHN"), "DOE")
		self.assertFalse(environment.getValue("JOHNDOE_IS_FOR_SURE_A_NON_EXISTING_SYSTEM_ENVIRONMENT_VARIABLE"))
Ejemplo n.º 2
0
    def testSetValue(self):
        """
		This method tests :meth:`foundations.environment.Environment.setValue` method.
		"""

        environment = Environment()
        self.assertTrue(environment.setValue("JANE", "DOE"))
        self.assertIn("JANE", os.environ)
        self.assertEqual(environment.getValue("JANE"), "DOE")
	def testSetValue(self):
		"""
		Tests :meth:`foundations.environment.Environment.setValue` method.
		"""

		environment = Environment()
		self.assertTrue(environment.setValue("JANE", "DOE"))
		self.assertIn("JANE", os.environ)
		self.assertEqual(environment.getValue("JANE"), "DOE")
Ejemplo n.º 4
0
    def testGetValue(self):
        """
		This method tests :meth:`foundations.environment.Environment.getValue` method.
		"""

        if platform.system() == "Windows" or platform.system() == "Microsoft":
            environment = Environment("APPDATA")
        elif platform.system() == "Darwin":
            environment = Environment("HOME")
        elif platform.system() == "Linux":
            environment = Environment("HOME")
        self.assertTrue(environment.getValue())
        self.assertIsInstance(environment.getValue(), str)
        environment.setValues(JOHN="DOE")
        self.assertEqual(environment.getValue("JOHN"), "DOE")
        self.assertFalse(
            environment.getValue(
                "JOHNDOE_IS_FOR_SURE_A_NON_EXISTING_SYSTEM_ENVIRONMENT_VARIABLE"
            ))