def test_variable_metastore_secrets_backend(self): Variable.set(key="hello", value="World") metastore_backend = MetastoreBackend() variable_value = metastore_backend.get_variable(key="hello") self.assertEqual("World", variable_value) self.assertIsNone( metastore_backend.get_variable(key="non_existent_key"))
def test_variable_metastore_secrets_backend(self): Variable.set(key="hello", value="World") Variable.set(key="empty_str", value="") metastore_backend = MetastoreBackend() variable_value = metastore_backend.get_variable(key="hello") assert "World" == variable_value assert metastore_backend.get_variable(key="non_existent_key") is None assert '' == metastore_backend.get_variable(key="empty_str")
def test_connection_metastore_secrets_backend(self): sample_conn_2 = SampleConn("sample_2", "A") with create_session() as session: session.add(sample_conn_2.conn) session.commit() metastore_backend = MetastoreBackend() conn_list = metastore_backend.get_connections("sample_2") host_list = {x.host for x in conn_list} self.assertEqual({sample_conn_2.host.lower()}, set(host_list))