Skip to content

Commit cfab514

Browse files
committed
Renamed identifier of pgstac source plugin.
1 parent 68dec6b commit cfab514

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Create a YAML configuration file to specify sources (where messages come from) a
5151
```yaml
5252
# Sources: Define where notifications come from
5353
sources:
54-
- type: postgres
54+
- type: pgstac
5555
config:
5656
host: localhost
5757
port: 5432
@@ -72,7 +72,7 @@ See [examples/config.yaml](./examples/config.yaml) for a complete configuration
7272
### Available Plugins
7373
7474
#### Sources
75-
- `postgres`: Monitor PostgreSQL/pgSTAC database changes
75+
- `pgstac`: Monitor PostgreSQL/pgSTAC database changes
7676

7777
#### Outputs
7878
- `mqtt`: Publish events to MQTT broker

eoapi_notifier/core/registry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def __init__(self) -> None:
117117
def _register_builtin_sources(self) -> None:
118118
"""Register built-in source types."""
119119
self.register(
120-
name="postgres",
120+
name="pgstac",
121121
module_path="eoapi_notifier.sources.pgstac",
122122
class_name="PgSTACSource",
123123
config_class_name="PgSTACSourceConfig",

examples/config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Sources: Define where notifications come from
55
sources:
66
# PostgreSQL/pgSTAC source for database changes
7-
- type: postgres
7+
- type: pgstac
88
config:
99
host: localhost
1010
port: 5432
@@ -36,15 +36,15 @@ outputs:
3636

3737
# Example with multiple sources and outputs
3838
# sources:
39-
# - type: postgres
39+
# - type: pgstac
4040
# config:
4141
# host: db1.example.com
4242
# port: 5432
4343
# database: stac_db
4444
# username: notifier
4545
# password: secret123
4646
#
47-
# - type: postgres
47+
# - type: pgstac
4848
# config:
4949
# host: db2.example.com
5050
# port: 5432

tests/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def test_successful_run(
103103
"""Test successful CLI run with valid configuration."""
104104
# Create test config file
105105
config_data = {
106-
"sources": [{"type": "postgres", "config": {"host": "localhost"}}],
106+
"sources": [{"type": "pgstac", "config": {"host": "localhost"}}],
107107
"outputs": [{"type": "mqtt", "config": {"broker_host": "localhost"}}],
108108
}
109109

tests/test_main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_initialization(self) -> None:
4949
def test_load_config_valid_yaml(self) -> None:
5050
"""Test loading valid YAML configuration."""
5151
config_data = {
52-
"sources": [{"type": "postgres", "config": {"host": "localhost"}}],
52+
"sources": [{"type": "pgstac", "config": {"host": "localhost"}}],
5353
"outputs": [{"type": "mqtt", "config": {"broker_host": "localhost"}}],
5454
}
5555

@@ -124,7 +124,7 @@ def test_create_plugins_success(
124124
mock_create_output.return_value = mock_output
125125

126126
config = {
127-
"sources": [{"type": "postgres", "config": {"host": "localhost"}}],
127+
"sources": [{"type": "pgstac", "config": {"host": "localhost"}}],
128128
"outputs": [{"type": "mqtt", "config": {"broker_host": "localhost"}}],
129129
}
130130

@@ -135,7 +135,7 @@ def test_create_plugins_success(
135135
assert self.app.sources[0] == mock_source
136136
assert self.app.outputs[0] == mock_output
137137

138-
mock_create_source.assert_called_once_with("postgres", {"host": "localhost"})
138+
mock_create_source.assert_called_once_with("pgstac", {"host": "localhost"})
139139
mock_create_output.assert_called_once_with("mqtt", {"broker_host": "localhost"})
140140

141141
@patch("eoapi_notifier.core.main.create_source")
@@ -173,7 +173,7 @@ def test_create_plugins_source_creation_error(
173173
"""Test handling of source creation errors."""
174174
mock_create_source.side_effect = Exception("Creation failed")
175175

176-
config = {"sources": [{"type": "postgres", "config": {"host": "localhost"}}]}
176+
config = {"sources": [{"type": "pgstac", "config": {"host": "localhost"}}]}
177177

178178
self.app.create_plugins(config)
179179

tests/test_pgstac_source.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ def test_status_info(self) -> None:
142142
class TestPgSTACSourceRegistry:
143143
"""Test pgSTAC source registry integration."""
144144

145-
def test_postgres_source_registered(self) -> None:
146-
"""Test that postgres source is registered."""
145+
def test_pgstac_source_registered(self) -> None:
146+
"""Test that pgstac source is registered."""
147147
available = get_available_sources()
148-
assert "postgres" in available
148+
assert "pgstac" in available
149149

150150
def test_create_source_from_registry(self) -> None:
151151
"""Test creating pgSTAC source through registry."""
@@ -157,7 +157,7 @@ def test_create_source_from_registry(self) -> None:
157157
"password": "test",
158158
}
159159

160-
source = create_source("postgres", config)
160+
source = create_source("pgstac", config)
161161

162162
assert isinstance(source, PgSTACSource)
163163
assert isinstance(source.config, PgSTACSourceConfig)
@@ -171,7 +171,7 @@ def test_create_source_with_validation_error(self) -> None:
171171
}
172172

173173
with pytest.raises(PluginError): # Should raise validation error
174-
create_source("postgres", config)
174+
create_source("pgstac", config)
175175

176176

177177
class TestPgSTACSource:

tests/test_plugin_system.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ class TestRegistryIntegration:
462462
@pytest.mark.parametrize(
463463
"registry,plugin_type",
464464
[
465-
(source_registry, "postgres"),
465+
(source_registry, "pgstac"),
466466
(output_registry, "mqtt"),
467467
],
468468
)

tests/test_registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def test_source_registry_initialization(self) -> None:
239239
"""Test source registry has built-in sources."""
240240
assert isinstance(source_registry, SourceRegistry)
241241
available = source_registry.list_registered()
242-
assert "postgres" in available
242+
assert "pgstac" in available
243243

244244
def test_output_registry_initialization(self) -> None:
245245
"""Test output registry has built-in outputs."""
@@ -279,7 +279,7 @@ def test_get_available_sources(self) -> None:
279279
"""Test getting available source types."""
280280
sources = get_available_sources()
281281
assert isinstance(sources, list)
282-
assert "postgres" in sources
282+
assert "pgstac" in sources
283283

284284
def test_get_available_outputs(self) -> None:
285285
"""Test getting available output types."""

0 commit comments

Comments
 (0)