def setup(self, tmpdir): globus_dir = tmpdir.mkdir('globus') auth_file = globus_dir.join('globus-auth') expiry = int(time.time()) + (60*60*24*365) self.fake_goauth_token = 'un=test|tokenid=fake-token-id|expiry=%d' % expiry auth_file.write(self.fake_goauth_token) settings = default_settings() settings.globus_auth_file = str(auth_file) self.globus = GlobusAPIClient(settings=settings)
def setup_settings(self, tmpdir): self.settings = default_settings() self.input_path = tmpdir.mkdir("input") self.output_path = tmpdir.mkdir("output") self.completed_path = self.output_path.mkdir("completed") self.uploaded_path = self.output_path.mkdir("uploaded") self.settings.payload_input_path = str(self.input_path) self.settings.payload_output_path = str(self.output_path) self.settings.payload_completed_path = str(self.completed_path) self.settings.payload_uploaded_path = str(self.uploaded_path) self.payload = EmopPayload(settings=self.settings, proc_id='1')
def setup(self, tmpdir): self.tmpout = str(tmpdir.mkdir("out")) globus_dir = tmpdir.mkdir('globus') auth_file = globus_dir.join('globus-auth') expiry = int(time.time()) + (60*60*24*365) self.fake_goauth_token = 'un=test|tokenid=fake-token-id|expiry=%d' % expiry auth_file.write(self.fake_goauth_token) settings = default_settings() settings.globus_auth_file = str(auth_file) with patch('emop.emop_transfer.GlobusAPIClient') as globus_class: mock_globus = GlobusAPIClient(settings=settings) globus_class.return_value = mock_globus self.transfer = EmopTransfer(config_path=default_config_path())
def setUp(self): self.settings = default_settings()