コード例 #1
0
    def test_rds_testfree_postgres(self):
        os.environ["VCAP_SERVICES"] = self.rds_vcap_example

        factory = DatabaseConfigurationFactory()

        config = factory.get_instance().get_m2ee_configuration()
        assert config["DatabaseType"] == "MySQL"
        assert config["DatabaseHost"] == "mysql.domain.local:3306"
        assert config["DatabaseName"] == "cf_databasename"
        assert config["DatabaseUserName"] == "xx"
        assert config["DatabasePassword"] == "yy"
コード例 #2
0
    def test_rds_testfree_postgres(self):
        os.environ["VCAP_SERVICES"] = self.rds_vcap_example

        factory = DatabaseConfigurationFactory()

        config = factory.get_instance().get_m2ee_configuration()
        assert config["DatabaseType"] == "PostgreSQL"
        assert (
            config["DatabaseHost"]
            == "rdsbroker-testfree-nonprod-1-eu-west-1.asdbjasdg.eu-west-1.rds.amazonaws.com:5432"  # noqa: E501
        )
        assert config["DatabaseName"] == "dbuajsdhkasdhaks"
        assert config["DatabaseJdbcUrl"].find("tcpKeepAlive") >= 0
コード例 #3
0
    def test_sap_hana_selection(self):
        os.environ["VCAP_SERVICES"] = self.sap_hana_vcap_example

        factory = DatabaseConfigurationFactory()
        assert factory.present_in_vcap("hana") is not None
        assert factory.present_in_vcap("hana",
                                       tags=["hana", "database", "relational"])
        assert factory.present_in_vcap(None,
                                       tags=["hana", "database", "relational"])

        assert factory.get_instance().database_type == "SAPHANA"