コード例 #1
0
ファイル: test_mk_postgres.py プロジェクト: LinuxHaus/checkmk
 def test_not_implemented_os(self):
     with pytest.raises(Exception) as e:
         mk_postgres.helper_factory().get_default_path()
     assert "is not yet implemented" in str(e.value)
     with pytest.raises(Exception) as e:
         mk_postgres.helper_factory().get_default_postgres_user()
     assert "is not yet implemented" in str(e.value)
コード例 #2
0
ファイル: test_mk_postgres.py プロジェクト: LinuxHaus/checkmk
 def test_config_with_instance(self, ):
     config = copy.deepcopy(VALID_CONFIG_WITH_INSTANCES)
     config[-1] = config[-1].format(sep=SEP_LINUX)
     sep = mk_postgres.helper_factory().get_conf_sep()
     dbuser, instances = mk_postgres.parse_postgres_cfg(config, sep)
     assert dbuser == "user_yz"
     assert len(instances) == 1
     assert instances[0]["pg_port"] == "5432"
     assert instances[0]["name"] == "db1"
     assert instances[0]["pg_user"] == "USER_NAME"
     assert instances[0]["pg_passfile"] == "/PATH/TO/.pgpass"
コード例 #3
0
ファイル: test_mk_postgres.py プロジェクト: LinuxHaus/checkmk
 def test_config_without_instance(self, ):
     sep = mk_postgres.helper_factory().get_conf_sep()
     dbuser, instances = mk_postgres.parse_postgres_cfg(
         VALID_CONFIG_WITHOUT_INSTANCE, sep)
     assert dbuser == "user_xy"
     assert len(instances) == 0
コード例 #4
0
ファイル: test_mk_postgres.py プロジェクト: LinuxHaus/checkmk
 def test_get_default_postgres_user(self, ):
     assert "postgres" == mk_postgres.helper_factory(
     ).get_default_postgres_user()
コード例 #5
0
ファイル: test_mk_postgres.py プロジェクト: LinuxHaus/checkmk
 def test_get_default_path(self, ):
     assert "/etc/check_mk" == mk_postgres.helper_factory(
     ).get_default_path()
コード例 #6
0
ファイル: test_mk_postgres.py プロジェクト: LinuxHaus/checkmk
 def test_get_default_path(self):
     assert ("c:\\ProgramData\\checkmk\\agent\\config" ==
             mk_postgres.helper_factory().get_default_path())