From cad13f17c37619b0383552600fddf2aca598472b Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 21 Jun 2024 15:46:17 -0300 Subject: [PATCH] refactor: Update test_data_components.py to assert file_dict instead of result.text in test_directory_without_mocks --- tests/unit/test_data_components.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_data_components.py b/tests/unit/test_data_components.py index a29f46021..79b6c300e 100644 --- a/tests/unit/test_data_components.py +++ b/tests/unit/test_data_components.py @@ -1,3 +1,4 @@ +import json import os from pathlib import Path from unittest.mock import Mock, patch @@ -176,7 +177,8 @@ def test_directory_without_mocks(): # each result is a Data that contains the content attribute # each are dict that are exactly the same as one of the projects for i, result in enumerate(results): - assert result.text in projects, list(diff(result.text, projects[i])) + file_dict = json.loads(result.text) + assert file_dict in projects, list(diff(file_dict, projects[i])) # in ../docs/docs/components there are many mdx files # check if the directory component can load them