Trouble faking a Laravel HttpClient response

I am trying to test the following bit of code: DimonaClient is just a simple wrapper around a Laravel HttpClient; simplified function here: The getDeclaration() response is a \Illuminate\Http\Client\Response What I am trying to do in my test is: Mock the DimonaClient class so I don’t create an actual api call "Mock" (use Laravel’s Http::response())… Read More Trouble faking a Laravel HttpClient response

Is there a way that with a for cicle I could run through the archives in a file in jupyter lab/python?

I’m doing an inform and with a group we run the experiment ten time and had created 10 csv files. But opening all one line of code at a time must not be the most efficient way to open and read them and I know there must be a way to open them with a… Read More Is there a way that with a for cicle I could run through the archives in a file in jupyter lab/python?

Test is not executed when pytest.fixture is used

I have a simple Python library, for which I use the following command to run tests: python setup.py pytest The following test works as expected: def test_out(): assert 1 == 2 Test result: platform linux — Python 3.10.4, pytest-7.1.2, pluggy-1.0.0 rootdir: /media/drive2/src collected 1 item tests/test_error.py F However, when @pytest.fixture is added, the test is… Read More Test is not executed when pytest.fixture is used

Why when fading out list of materials each material fade out in another time and not all the materials fade at the same time?

using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; public class FadeInOut : MonoBehaviour { List<Material> mats = new List<Material>(); private void Start() { foreach (Transform g in transform.GetComponentsInChildren<Transform>()) { if (g.GetComponent<SkinnedMeshRenderer>() != null) { var l = g.GetComponent<SkinnedMeshRenderer>().sharedMaterials.ToList(); foreach(Material mat in l) { mats.Add(mat); } } } } private void Update() { if(Input.GetKeyDown(KeyCode.G)) { StartCoroutine(FadeTo(mats,… Read More Why when fading out list of materials each material fade out in another time and not all the materials fade at the same time?

how can I create a fake promise that answers with a done function?

I have this code, which does not work if vID=0 because ajax.done does is not a function: if (vID > 0) { var ajax = CallPHP(‘GET’, ‘grid_main.php’, "idquery=7&trkbid=" + vID); } else { // Here I need a fake ajax so that the following code will work var ajax=new Promise(); }; ajax.done(function(data, textStatus, jqXHR) {… Read More how can I create a fake promise that answers with a done function?