File size: 1,571 Bytes
c21a217
 
 
 
aa26954
c21a217
 
aa26954
c21a217
 
 
 
 
 
 
 
a342aec
c21a217
 
 
 
aa26954
 
c21a217
aa26954
 
 
 
 
 
 
 
 
c21a217
 
 
a342aec
c21a217
 
 
 
aa26954
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""
Test for resume generation functionality
"""

import json
import unittest
from functions.gradio import process_inputs
from functions.writer_agent import write_resume

class TestResumeGeneration(unittest.TestCase):
    """Test to run resume generation on pre-defined inputs."""

    def setUp(self):
        """Set up the test case with pre-defined inputs."""

        self.linkedin_pdf_path = "tests/test_data/linkedin_profile.pdf"
        self.github_username = "gperdrizet"

        with open('tests/test_data/sample_job.txt', 'r', encoding='utf-8') as f:
            self.job_post_text = f.read().strip()

        with open('tests/test_data/github_repos.json', 'r', encoding='utf-8') as f:
            self.github_repositories = json.load(f)

        with open('tests/test_data/job_call.json', 'r', encoding='utf-8') as f:
            self.job_call = json.load(f)

        with open('tests/test_data/linkedin_resume.json', 'r', encoding='utf-8') as f:
            self.linkedin_resume = json.load(f)


    def test_process_inputs(self):
        """Test input preprocessing for resume generation with pre-defined inputs."""

        result = process_inputs(
            linkedin_pdf_path=self.linkedin_pdf_path,
            github_username=self.github_username,
            job_post_text=self.job_post_text,
        )

        print(result)

    def test_write_resume(self):
        """Test resume writing functionality with pre-defined inputs."""

        result = write_resume(self.linkedin_resume, self.github_repositories, self.job_call)

        print(result)