Skip to content

Commit

Permalink
Use keyword argument in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon authored Nov 25, 2024
1 parent 1aceb57 commit 4f9deb3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_slot_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ def setUp(self):
def test_default_slot_name(self):
# Test backward compatibility when slot name is not provided.
config = self.default_config
tap = TapPostgres(config)
tap = TapPostgres(config=config)
self.assertEqual(
tap.config.get("replication_slot_name", "tappostgres"), "tappostgres"
)

def test_custom_slot_name(self):
# Test if the custom slot name is used.
config = {**self.default_config, "replication_slot_name": "custom_slot"}
tap = TapPostgres(config)
tap = TapPostgres(config=config)
self.assertEqual(tap.config["replication_slot_name"], "custom_slot")

def test_multiple_slots(self):
# Simulate using multiple configurations with different slot names.
config_1 = {**self.default_config, "replication_slot_name": "slot_1"}
config_2 = {**self.default_config, "replication_slot_name": "slot_2"}

tap_1 = TapPostgres(config_1)
tap_2 = TapPostgres(config_2)
tap_1 = TapPostgres(config=config_1)
tap_2 = TapPostgres(config=config_2)

self.assertNotEqual(
tap_1.config["replication_slot_name"],
Expand All @@ -48,4 +48,4 @@ def test_invalid_slot_name(self):
}

with self.assertRaises(ValueError):
TapPostgres(invalid_config)
TapPostgres(config=invalid_config)

0 comments on commit 4f9deb3

Please sign in to comment.