mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-11-02 13:12:50 +00:00
Fix salary tool edge cases (#75)
* fix: handle salary tool edge cases * fix: preserve Danish salary compounds
This commit is contained in:
1 parent
d4415dff16
commit
9e26de2c67
4 files changed
+68
-10
No files matched your search
@@ -0,0 +1,41 @@
|
||||
import unittest
|
||||
|
||||
from salary_lookup import format_entry
|
||||
|
||||
|
||||
class FormatEntryTests(unittest.TestCase):
|
||||
def test_zero_count_is_displayed_as_zero(self):
|
||||
entry = {
|
||||
"company": "Example Corp",
|
||||
"city": "",
|
||||
"categories": {
|
||||
"public_data": {
|
||||
"count": 0,
|
||||
"index": 100.0,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
rendered = format_entry(entry, {"index_baseline": 100, "index_label": "Index"})
|
||||
|
||||
self.assertRegex(rendered, r"Public Data\s+0\s+100\.0")
|
||||
|
||||
def test_text_index_does_not_crash(self):
|
||||
entry = {
|
||||
"company": "Example Corp",
|
||||
"city": "",
|
||||
"categories": {
|
||||
"sample": {
|
||||
"count": 3,
|
||||
"index": "private",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
rendered = format_entry(entry, {"index_baseline": 100, "index_label": "Index"})
|
||||
|
||||
self.assertIn("private", rendered)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user