Ejemplo n.º 1
0
 def _execute(self):
     Session.set_environment(self.args.environment)
     if self.args.commit == 'none':
         commit = Session.project_repo.head().decode(encoding='ascii')
     else:
         commit = self.args.commit
     execute_ticket(self.args.ticket, self.action, commit, False)
Ejemplo n.º 2
0
 def _execute(self):
     Session.set_environment(self.args.environment)
     if self.args.commit == 'none':
         commit = None
     else:
         commit = self.args.commit
     execute_ticket(self.args.ticket, self.action, commit, False)
Ejemplo n.º 3
0
 def _execute(self):
     Session.set_environment(self.args.environment)
     kwargs = {
         **Session.environment['database'],
         **Session.credentials,
         **self.args.__dict__}
     run_sql_script(self._logger, **kwargs)
Ejemplo n.º 4
0
 def _execute(self):
     Session.set_environment(self.args.environment)
     if self.args.commit == 'none':
         commit = None
     else:
         commit = self.args.commit
     self._checkout_package(self.args.package, commit)
Ejemplo n.º 5
0
    def _execute(self):
        Session.set_environment(self.args.environment)

        file_path = os.path.join(self.args.directory, self.args.file)

        run_sql_script(
            self._logger,
            file_path)
Ejemplo n.º 6
0
def test_set_environment(project_repo):
    env = 'test'
    Session.set_environment(env)
    config = Repo(str(Session.matador_repository_folder)).get_config()
    assert config.get(b'core', b'sparsecheckout') == b'true'
    assert Session.matador_project_folder.is_dir()
    assert Session.matador_repository_folder.is_dir()
    assert Session.environment == environments[env]
    assert Session.credentials == credentials[env]
    assert Session.matador_environment_folder == Path(
        Path.home(), '.matador', project, env)
    assert Session.matador_tickets_folder == Path(
        Path.home(), '.matador', project, env, 'tickets')
    assert Session.matador_packages_folder == Path(
        Path.home(), '.matador', project, env, 'packages')
    assert Session.matador_environment_folder.is_dir()
    assert Session.matador_tickets_folder.is_dir()
    assert Session.matador_packages_folder.is_dir()