Skip to content

Commit

Permalink
ref(flags): add LRU update/dedupe test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
aliu39 committed Feb 20, 2025
1 parent 48ebd73 commit 550cdb8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_feature_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,25 @@ def test_flag_tracking():
{"flag": "f", "result": False},
]

# Test updates
buffer.set("e", True)
buffer.set("e", False)
buffer.set("e", True)
flags = buffer.get()
assert flags == [
{"flag": "d", "result": False},
{"flag": "f", "result": False},
{"flag": "e", "result": True},
]

buffer.set("d", True)
flags = buffer.get()
assert flags == [
{"flag": "f", "result": False},
{"flag": "e", "result": True},
{"flag": "d", "result": True},
]


def test_flag_buffer_concurrent_access():
buffer = FlagBuffer(capacity=100)
Expand Down

0 comments on commit 550cdb8

Please sign in to comment.