def test_updating_osx_path_only_update_repo_path_if_on_osx(self): """testing if updating the osx path will only update the path if the system is osx """ self.patcher.patch('Windows') from stalker import db, defaults db.setup({'sqlalchemy.url': 'sqlite:///:memory:'}) repo = Repository(name='Test Repo', linux_path='/mnt/T', osx_path='/Volumes/T', windows_path='T:/') db.DBSession.add(repo) db.DBSession.commit() import os self.assertTrue(defaults.repo_env_var_template % {'id': repo.id} in os.environ) # now update the repository test_value = '/Volumes/S/' repo.osx_path = test_value # expect the environment variable not updated self.assertNotEqual( os.environ[defaults.repo_env_var_template % { 'id': repo.id }], test_value) self.assertEqual( os.environ[defaults.repo_env_var_template % { 'id': repo.id }], repo.windows_path) # make it osx self.patcher.patch('Darwin') # now update the repository test_value = '/Volumes/S/' repo.osx_path = test_value # expect the environment variable not updated self.assertEqual( os.environ[defaults.repo_env_var_template % { 'id': repo.id }], test_value) self.assertEqual( os.environ[defaults.repo_env_var_template % { 'id': repo.id }], repo.osx_path)
def test_updating_osx_path_only_update_repo_path_if_on_osx(self): """testing if updating the osx path will only update the path if the system is osx """ self.patcher.patch('Windows') from stalker import defaults, Repository repo = Repository(name='Test Repo', linux_path='/mnt/T', osx_path='/Volumes/T', windows_path='T:/') from stalker.db.session import DBSession DBSession.add(repo) DBSession.commit() import os assert defaults.repo_env_var_template % {'id': repo.id} in os.environ # now update the repository test_value = '/Volumes/S/' repo.osx_path = test_value # expect the environment variable not updated assert \ os.environ[defaults.repo_env_var_template % {'id': repo.id}] != \ test_value assert \ os.environ[defaults.repo_env_var_template % {'id': repo.id}] == \ repo.windows_path # make it osx self.patcher.patch('Darwin') # now update the repository test_value = '/Volumes/S/' repo.osx_path = test_value # expect the environment variable not updated assert \ os.environ[defaults.repo_env_var_template % {'id': repo.id}] == \ test_value assert \ os.environ[defaults.repo_env_var_template % {'id': repo.id}] == \ repo.osx_path
print(anim.computed_start) # 2014-04-17 13:00:00 print(anim.computed_end) # 2014-04-23 17:00:00 print(lighting.computed_start) # 2014-04-23 17:00:00 print(lighting.computed_end) # 2014-04-24 11:00:00 print(comp.computed_start) # 2014-04-24 11:00:00 print(comp.computed_end) # 2014-04-24 17:00:00 print(my_studio.to_tjp) print(me.to_tjp) print(comp.to_tjp) print(new_project.to_tjp) commercial_repo.linux_path = "/mnt/M/commercials" commercial_repo.osx_path = "/Volumes/M/commercials" commercial_repo.windows_path = "M:/commercials" # you can use reverse slashes # (\\) if you want print(commercial_repo.path) # under Windows outputs: # M:/commercials # # in Linux and variants: # /mnt/M/commercials # # and in OSX: # /Volumes/M/commercials from stalker import Structure