コード例 #1
0
    def test_make_splunkhome_path_default(self):
        """
        Ensure that make_splunkhome_path works using core Splunk's function.
        """

        self.assertTrue(
            make_splunkhome_path(['var', 'log', 'splunk', 'test.log'],
                                 False).endswith('/var/log/splunk/test.log'))
コード例 #2
0
ファイル: unit.py プロジェクト: SSITB/splunk-modular-input
    def test_make_splunkhome_path_builtin(self):
        """
        Ensure that make_splunkhome_path works using the built-in function.
        """

        if 'SPLUNK_HOME' not in os.environ:
            os.environ['SPLUNK_HOME'] = '/opt/splunk'

        self.assertTrue(make_splunkhome_path(['var', 'log', 'splunk', 'test.log'], True).endswith('/var/log/splunk/test.log'))