File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed
Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,58 @@ def test_extract_candidate_info(candidate_md: str):
5555 }
5656
5757
58+ def test_extract_candidate_info_array_format ():
59+ # This is the old/non-standard format, but we should still test for it for backwards compatibility.
60+ """Test parsing candidate info with array format"""
61+ candidate_md_array = """-------------------------------------------------------------
62+ name: Jane Doe
63+ ID: jdoe
64+ info:
65+ - employer: Example Corp
66+ - slack: jane.doe
67+ -------------------------------------------------------------
68+
69+ ## Bio
70+
71+ Sample bio content here.
72+ """
73+ info = extract_candidate_info (candidate_md_array )
74+ assert info == {
75+ 'name' : 'Jane Doe' ,
76+ 'ID' : 'jdoe' ,
77+ 'info' : [
78+ {'employer' : 'Example Corp' },
79+ {'slack' : 'jane.doe' }
80+ ]
81+ }
82+
83+
84+ def test_extract_candidate_info_object_format ():
85+ # This is the proper yaml format
86+ """Test parsing candidate info with object format"""
87+ candidate_md_object = """-------------------------------------------------------------
88+ name: John Smith
89+ ID: jsmith
90+ info:
91+ employer: Tech Company
92+ slack: john.smith
93+ -------------------------------------------------------------
94+
95+ ## Bio
96+
97+ Sample bio content here.
98+ """
99+ info = extract_candidate_info (candidate_md_object )
100+ assert info == {
101+ 'name' : 'John Smith' ,
102+ 'ID' : 'jsmith' ,
103+ 'info' : {
104+ 'employer' : 'Tech Company' ,
105+ 'slack' : 'john.smith'
106+ }
107+ }
108+
109+
58110def test_extract_candidate_description (candidate_md ):
59111 assert extract_candidate_description (candidate_md ) == (
60112 '## Reason for Name\n \n '
You can’t perform that action at this time.
0 commit comments