Пример #1
0
    def test_GpReadConfig_returns_selected_guc_with_whitespace_before_key(self, mock_run, mock_results, mock_init):
        seg = self.gparray.master
        args = dict(name="my_command",
                    host="host",
                    seg=seg,
                    guc_name="statement_mem",
        )

        subject = GpReadConfig(**args)

        subject.run(validateAfter=True)
        self.assertEquals('200', subject.get_guc_value())
Пример #2
0
    def test_GpReadConfig_returns_selected_guc_with_whitespace_before_key(self, mock_run, mock_results, mock_init):
        seg = self.gparray.master
        args = dict(name="my_command",
                    host="host",
                    seg=seg,
                    guc_name="statement_mem",
        )

        subject = GpReadConfig(**args)

        subject.run(validateAfter=True)
        self.assertEquals('200', subject.get_guc_value())
Пример #3
0
    def test_GpReadConfig_returns_selected_guc(self, mock_hostname, mock_run,
                                               mock_results, mock_init):
        seg = self.gparray.master
        args = dict(
            name="my_command",
            seg=seg,
            guc_name="statement_mem",
        )

        subject = GpReadConfig(**args)
        init_args = mock_init.call_args_list
        self.assertEquals(init_args[0][0][3], 1)  # ctxt.LOCAL
        self.assertEquals(init_args[0][0][4], None)

        subject.run(validateAfter=True)
        self.assertEquals('200', subject.get_guc_value())
Пример #4
0
    def test_GpReadConfig_returns_selected_guc_on_remote_segment(
            self, mock_hostname, mock_run, mock_results, mock_init):
        seg = self.gparray.segmentPairs[0].primaryDB
        args = dict(
            name="my_command",
            seg=seg,
            guc_name="statement_mem",
        )

        subject = GpReadConfig(**args)
        init_args = mock_init.call_args_list
        self.assertEquals(init_args[0][0][3], 2)  # ctxt.REMOTE
        self.assertEquals(init_args[0][0][4], "sdw1")

        subject.run(validateAfter=True)
        self.assertEquals('200', subject.get_guc_value())