Example #1
0
    def test_file_exists_json_is_loaded(self):
        self.assertIsNone(os.environ.get(self.ENVIRONMENT_VARIABLE))

        self.create_environment_json_file('foo')
        loadenv()

        self.assertEqual(os.environ.get(self.ENVIRONMENT_VARIABLE), 'foo')
Example #2
0
    def test_file_overwrites_existing_value(self):
        os.environ[self.ENVIRONMENT_VARIABLE] = 'bar'
        self.assertEqual(os.environ.get(self.ENVIRONMENT_VARIABLE), 'bar')

        self.create_environment_json_file('baz')
        loadenv()

        self.assertEqual(os.environ.get(self.ENVIRONMENT_VARIABLE), 'baz')
Example #3
0
 def test_no_file_environment_variable_not_set(self):
     self.assertIsNone(os.environ.get(self.ENVIRONMENT_VARIABLE))
     loadenv()
     self.assertIsNone(os.environ.get(self.ENVIRONMENT_VARIABLE))