isayahc commited on
Commit
95b3333
·
1 Parent(s): a17f77f

removed hardcorded value in tempfile

Browse files
innovation_pathfinder_ai/test/test_vectorstore.py CHANGED
@@ -44,8 +44,9 @@ class TestVectorStore(unittest.TestCase):
44
 
45
  def test_add_image_to_vector_store(self):
46
  image_url = "https://www.python.org/static/community_logos/python-logo-master-v3-TM.png"
 
47
  response = requests.get(image_url)
48
- with tempfile.NamedTemporaryFile(delete=False, suffix=".png") as temp_file:
49
  temp_file.write(response.content) # Write the image content to the temporary file
50
  temp_file_name = temp_file.name # Get the temporary file name
51
  add_image_to_vector_store(
 
44
 
45
  def test_add_image_to_vector_store(self):
46
  image_url = "https://www.python.org/static/community_logos/python-logo-master-v3-TM.png"
47
+ image_extention_name = os.path.basename(image_url)
48
  response = requests.get(image_url)
49
+ with tempfile.NamedTemporaryFile(delete=False, suffix=image_extention_name) as temp_file:
50
  temp_file.write(response.content) # Write the image content to the temporary file
51
  temp_file_name = temp_file.name # Get the temporary file name
52
  add_image_to_vector_store(