def test_env_variables_is_working_properly_in_osx(self): """testing if environment variables are properly defined by using the os name """ global platform_name platform_name = "Darwin" self.assertEqual( "Darwin", platform.system() ) try: os.environ.pop('ENV1') except KeyError: pass os.environ['ENV1'] = '/Volumes/Z/Test/Value' discover_env_vars('test_env') self.assertEqual( '/Volumes/Z/Test/Value:/Volumes/Z/some/path1:/Volumes/Z/some/path2:' '/Volumes/Z/some/other/path1:/Volumes/Z/some/other/path2', os.environ['ENV1'] ) '/Volumes/Z/Test/Value:/Volumes/Z/some/path1:/Volumes/Z/some/path2:/Volumes/Z/some/other/path1:/Volumes/Z/some/other/path2' '/Volumes/Z/Test/Value:/mnt/Z/some/path1:/mnt/Z/some/path2:/mnt/Z/some/other/path1:/mnt/Z/some/other/path2'
def test_env_json_will_be_searched_in_anima_path(self): """testing if the env.json file will be searched in the path that ANIMAPATH is pointing too. """ self.assertFalse('ENV1' in os.environ) discover_env_vars() self.assertTrue('ENV1' in os.environ)
def test_env_variables_is_working_properly_in_osx(self): """testing if environment variables are properly defined by using the os name """ global platform_name platform_name = "Darwin" self.assertEqual( "Darwin", platform.system() ) try: os.environ.pop('ENV1') except KeyError: pass os.environ['ENV1'] = '/Volumes/Z/Test/Value' discover_env_vars('test_env') self.assertEqual( '/Volumes/Z/Test/Value%(pathsep)s/Volumes/Z/some/path1%(pathsep)s' '/Volumes/Z/some/path2%(pathsep)s/Volumes/Z/some/other/path1' '%(pathsep)s/Volumes/Z/some/other/path2' % { 'pathsep': os.path.pathsep }, os.environ['ENV1'] )
def test_env_variables_defined_in_system_will_not_be_overwritten(self): """testing if environment variables defined in system will not be overwritten """ os.environ['ENV1'] = '/Test/Value' discover_env_vars() self.assertEqual('/Test/Value:/mnt/Z/some/path1:/mnt/Z/some/path2', os.environ['ENV1'])
def test_env_variables_defined_with_asterix_will_defined_unrelated_to_the_env_name_argument( self): """testing if environment variables defined with the "*" environment name will be defined no matter what is given for the env_name argument """ os.environ['ENV1'] = '/Test/Value' discover_env_vars('some_env_name') self.assertEqual('/Test/Value:/mnt/Z/some/path1:/mnt/Z/some/path2', os.environ['ENV1'])
def test_env_variables_defined_with_asterix_will_defined_unrelated_to_the_env_name_argument(self): """testing if environment variables defined with the "*" environment name will be defined no matter what is given for the env_name argument """ os.environ['ENV1'] = '/Test/Value' discover_env_vars('some_env_name') self.assertEqual( '/Test/Value:/mnt/Z/some/path1:/mnt/Z/some/path2', os.environ['ENV1'] )
def test_env_variables_defined_in_system_will_not_be_overwritten(self): """testing if environment variables defined in system will not be overwritten """ os.environ['ENV1'] = '/Test/Value' discover_env_vars() self.assertEqual( '/Test/Value:/mnt/Z/some/path1:/mnt/Z/some/path2', os.environ['ENV1'] )
def test_env_variables_will_appended_to_the_ones_defined_in_asterix(self): """testing if environment variables defined with other env names will be append to the ones defined in "*" """ global platform_name platform_name = 'Linux' os.environ['ENV1'] = '/Test/Value' discover_env_vars('test_env') self.assertEqual( '/Test/Value:/mnt/Z/some/path1:/mnt/Z/some/path2:' '/mnt/Z/some/other/path1:/mnt/Z/some/other/path2', os.environ['ENV1'])
def test_env_variables_will_appended_to_the_ones_defined_in_asterix(self): """testing if environment variables defined with other env names will be append to the ones defined in "*" """ global platform_name platform_name = 'Linux' os.environ['ENV1'] = '/Test/Value' discover_env_vars('test_env') self.assertEqual( '/Test/Value:/mnt/Z/some/path1:/mnt/Z/some/path2:' '/mnt/Z/some/other/path1:/mnt/Z/some/other/path2', os.environ['ENV1'] )
def test_env_variables_is_working_properly_in_windows(self): """testing if environment variables are properly defined by using the os name """ global platform_name platform_name = "Windows" try: os.environ.pop('ENV1') except KeyError: pass os.environ['ENV1'] = 'Z:/Test/Value' discover_env_vars('test_env') self.assertEqual( 'Z:/Test/Value:Z:/some/path1:Z:/some/path2:' 'Z:/some/other/path1:Z:/some/other/path2', os.environ['ENV1'])
def test_env_variables_is_working_properly_in_windows(self): """testing if environment variables are properly defined by using the os name """ global platform_name platform_name = "Windows" try: os.environ.pop('ENV1') except KeyError: pass os.environ['ENV1'] = 'Z:/Test/Value' discover_env_vars('test_env') self.assertEqual( 'Z:/Test/Value:Z:/some/path1:Z:/some/path2:' 'Z:/some/other/path1:Z:/some/other/path2', os.environ['ENV1'] )
def test_env_variables_is_working_properly_in_linux(self): """testing if environment variables are properly defined by using the os name """ global platform_name platform_name = "Linux" try: os.environ.pop('ENV1') except KeyError: pass os.environ['ENV1'] = '/Test/Value' discover_env_vars('test_env') self.assertEqual( '/Test/Value%(pathsep)s/mnt/Z/some/path1%(pathsep)s' '/mnt/Z/some/path2%(pathsep)s/mnt/Z/some/other/path1%(pathsep)s' '/mnt/Z/some/other/path2' % {'pathsep': os.path.pathsep}, os.environ['ENV1'] )