1 line
12 KiB
JSON
1 line
12 KiB
JSON
{"created": 1755265903.423293, "duration": 5.901197910308838, "exitcode": 1, "root": "/workspace/tligui_y/slic", "environment": {}, "summary": {"failed": 5, "total": 5, "collected": 5}, "collectors": [{"nodeid": "", "outcome": "passed", "result": [{"nodeid": "tests/test_utils_elog.py", "type": "Module"}]}, {"nodeid": "tests/test_utils_elog.py", "outcome": "passed", "result": [{"nodeid": "tests/test_utils_elog.py::test_get_default_elog_instance_with_direct_password_and_real_check", "type": "Function", "lineno": 12}, {"nodeid": "tests/test_utils_elog.py::test_get_default_elog_instance_with_wrong_password_and_real_check", "type": "Function", "lineno": 37}, {"nodeid": "tests/test_utils_elog.py::test_get_default_elog_instance_asks_password_and_opens", "type": "Function", "lineno": 46}, {"nodeid": "tests/test_utils_elog.py::test_get_default_elog_with_path_home", "type": "Function", "lineno": 72}, {"nodeid": "tests/test_utils_elog.py::test_screenshot", "type": "Function", "lineno": 121}]}], "tests": [{"nodeid": "tests/test_utils_elog.py::test_get_default_elog_instance_with_direct_password_and_real_check", "lineno": 12, "outcome": "failed", "keywords": ["test_get_default_elog_instance_with_direct_password_and_real_check", "test_utils_elog.py", "tests", "slic", ""], "setup": {"duration": 0.0003935829736292362, "outcome": "passed"}, "call": {"duration": 0.10119548114016652, "outcome": "failed", "crash": {"path": "/workspace/tligui_y/slic/tests/test_utils_elog.py", "lineno": 35, "message": "AssertionError: Message not found\nassert 'This\\xa0is\\xa0a\\xa0message1' in '\\n\\n\\nELOG Login\\n\\n\\n\\n\\n\\n\\n\\nPlease login\\n\\n\\nUsername\\n\\n\\n\\n\\nPassword\\n\\n\\n\\nKeep me logged in on this computer\\nfor the next 31 days or until I log out\\n\\nForgot password?\\n\\nELOG V3.1.5-1272bc14\\n'"}, "traceback": [{"path": "tests/test_utils_elog.py", "lineno": 35, "message": "AssertionError"}], "longrepr": "def test_get_default_elog_instance_with_direct_password_and_real_check():\n url = \"http://localhost:8080/demo\"\n user = \"robot\"\n password = \"testpassword\"\n text = \"This is a message1\"\n \n elog = Elog(\"http://localhost:8080/demo\", user=user, password=password)\n \n try:\n elog.post(text)\n except Exception as e:\n pytest.fail(f\"elog.open() raised an unexpected exception: {e}\")\n \n response = requests.get(url)\n \n print(\"Texte bruuuut :\", response.content)\n \n soup = BeautifulSoup(response.content, 'html.parser')\n content = soup.get_text()\n \n print(\"Texte brut :\", content)\n \n> assert 'This\\xa0is\\xa0a\\xa0message1' in content, \"Message not found\"\nE AssertionError: Message not found\nE assert 'This\\xa0is\\xa0a\\xa0message1' in '\\n\\n\\nELOG Login\\n\\n\\n\\n\\n\\n\\n\\nPlease login\\n\\n\\nUsername\\n\\n\\n\\n\\nPassword\\n\\n\\n\\nKeep me logged in on this computer\\nfor the next 31 days or until I log out\\n\\nForgot password?\\n\\nELOG V3.1.5-1272bc14\\n'\n\ntests/test_utils_elog.py:35: AssertionError"}, "teardown": {"duration": 0.0003949780948460102, "outcome": "passed"}}, {"nodeid": "tests/test_utils_elog.py::test_get_default_elog_instance_with_wrong_password_and_real_check", "lineno": 37, "outcome": "failed", "keywords": ["test_get_default_elog_instance_with_wrong_password_and_real_check", "test_utils_elog.py", "tests", "slic", ""], "setup": {"duration": 0.00015589827671647072, "outcome": "passed"}, "call": {"duration": 0.0035901949740946293, "outcome": "failed", "crash": {"path": "/workspace/tligui_y/slic/tests/test_utils_elog.py", "lineno": 44, "message": "Failed: DID NOT RAISE <class 'elog.logbook_exceptions.LogbookAuthenticationError'>"}, "traceback": [{"path": "tests/test_utils_elog.py", "lineno": 44, "message": "Failed"}], "longrepr": "def test_get_default_elog_instance_with_wrong_password_and_real_check():\n url = \"http://localhost:8080/demo\"\n user = \"robot\"\n wrong_password = \"wrongpassword\"\n \n with pytest.raises(LogbookAuthenticationError):\n> Elog(url, user=user, password=wrong_password)\nE Failed: DID NOT RAISE <class 'elog.logbook_exceptions.LogbookAuthenticationError'>\n\ntests/test_utils_elog.py:44: Failed"}, "teardown": {"duration": 0.00020591914653778076, "outcome": "passed"}}, {"nodeid": "tests/test_utils_elog.py::test_get_default_elog_instance_asks_password_and_opens", "lineno": 46, "outcome": "failed", "keywords": ["test_get_default_elog_instance_asks_password_and_opens", "__wrapped__", "patchings", "test_utils_elog.py", "tests", "slic", ""], "setup": {"duration": 0.00015307310968637466, "outcome": "passed"}, "call": {"duration": 0.06297058099880815, "outcome": "failed", "crash": {"path": "/workspace/tligui_y/slic/tests/test_utils_elog.py", "lineno": 69, "message": "AssertionError: Message not found\nassert 'This\\xa0is\\xa0a\\xa0message2' in '\\n\\n\\nELOG Login\\n\\n\\n\\n\\n\\n\\n\\nPlease login\\n\\n\\nUsername\\n\\n\\n\\n\\nPassword\\n\\n\\n\\nKeep me logged in on this computer\\nfor the next 31 days or until I log out\\n\\nForgot password?\\n\\nELOG V3.1.5-1272bc14\\n'"}, "traceback": [{"path": "tests/test_utils_elog.py", "lineno": 69, "message": "AssertionError"}], "longrepr": "mock_home = <MagicMock name='home' id='140371429771872'>\nmock_getpass = <MagicMock name='getpass' id='140371424261168'>\n\n @patch(\"slic.utils.elog.getpass\")\n @patch(\"slic.utils.elog.Path.home\")\n def test_get_default_elog_instance_asks_password_and_opens(mock_home, mock_getpass):\n mock_home.return_value = Path(\"/does/not/exist\") # Fausse home \u2192 lecture \u00e9choue\n mock_getpass.return_value = \"testpassword\"\n user = \"robot\"\n text = \"This is a message2\"\n url = \"http://localhost:8080/demo\"\n \n elog = Elog(\"http://localhost:8080/demo\", user=user)\n \n try:\n elog.post(text)\n except Exception as e:\n pytest.fail(f\"elog.open() raised an unexpected exception: {e}\")\n \n response = requests.get(url)\n soup = BeautifulSoup(response.content, 'html.parser')\n content = soup.get_text()\n \n print(\"Password failing : \", content)\n \n> assert 'This\\xa0is\\xa0a\\xa0message2' in content, \"Message not found\"\nE AssertionError: Message not found\nE assert 'This\\xa0is\\xa0a\\xa0message2' in '\\n\\n\\nELOG Login\\n\\n\\n\\n\\n\\n\\n\\nPlease login\\n\\n\\nUsername\\n\\n\\n\\n\\nPassword\\n\\n\\n\\nKeep me logged in on this computer\\nfor the next 31 days or until I log out\\n\\nForgot password?\\n\\nELOG V3.1.5-1272bc14\\n'\n\ntests/test_utils_elog.py:69: AssertionError"}, "teardown": {"duration": 0.0002766568213701248, "outcome": "passed"}}, {"nodeid": "tests/test_utils_elog.py::test_get_default_elog_with_path_home", "lineno": 72, "outcome": "failed", "keywords": ["test_get_default_elog_with_path_home", "__wrapped__", "patchings", "test_utils_elog.py", "tests", "slic", ""], "setup": {"duration": 0.00015017017722129822, "outcome": "passed"}, "call": {"duration": 0.05750225018709898, "outcome": "failed", "crash": {"path": "/workspace/tligui_y/slic/tests/test_utils_elog.py", "lineno": 101, "message": "AssertionError: Message not found\nassert 'This\\xa0is\\xa0a\\xa0message3' in '\\n\\n\\nELOG Login\\n\\n\\n\\n\\n\\n\\n\\nPlease login\\n\\n\\nUsername\\n\\n\\n\\n\\nPassword\\n\\n\\n\\nKeep me logged in on this computer\\nfor the next 31 days or until I log out\\n\\nForgot password?\\n\\nELOG V3.1.5-1272bc14\\n'"}, "traceback": [{"path": "tests/test_utils_elog.py", "lineno": 101, "message": "AssertionError"}], "longrepr": "mock_home = <MagicMock name='home' id='140371424372432'>\nmock_getuser = <MagicMock name='getuser' id='140371423718512'>\nmock_getpass = <MagicMock name='getpass' id='140371424348768'>\n\n @patch(\"slic.utils.elog.getpass\")\n @patch(\"slic.utils.elog.getuser\")\n @patch(\"slic.utils.elog.Path.home\")\n def test_get_default_elog_with_path_home(mock_home, mock_getuser, mock_getpass):\n fake_user = \"robot\"\n fake_pw = \"testpassword\"\n mock_getuser.return_value = fake_user\n mock_getpass.return_value = fake_pw # fallback safety\n text = \"This is a message3\"\n url = \"http://localhost:8080/demo\"\n \n tmp_home = Path(\"/tmp/fake_home_for_robot\")\n tmp_home.mkdir(parents=True, exist_ok=True)\n pw_file = tmp_home / \".elog_psi\"\n pw_file.write_text(fake_pw)\n mock_home.return_value = tmp_home\n \n try:\n elog = Elog(\"http://localhost:8080/demo\")\n try:\n elog.post(text)\n except Exception as e:\n pytest.fail(f\"elog.open() raised an unexpected exception: {e}\")\n \n response = requests.get(url)\n soup = BeautifulSoup(response.content, 'html.parser')\n content = soup.get_text()\n \n> assert 'This\\xa0is\\xa0a\\xa0message3' in content, \"Message not found\"\nE AssertionError: Message not found\nE assert 'This\\xa0is\\xa0a\\xa0message3' in '\\n\\n\\nELOG Login\\n\\n\\n\\n\\n\\n\\n\\nPlease login\\n\\n\\nUsername\\n\\n\\n\\n\\nPassword\\n\\n\\n\\nKeep me logged in on this computer\\nfor the next 31 days or until I log out\\n\\nForgot password?\\n\\nELOG V3.1.5-1272bc14\\n'\n\ntests/test_utils_elog.py:101: AssertionError"}, "teardown": {"duration": 0.00024523166939616203, "outcome": "passed"}}, {"nodeid": "tests/test_utils_elog.py::test_screenshot", "lineno": 121, "outcome": "failed", "keywords": ["test_screenshot", "__wrapped__", "patchings", "test_utils_elog.py", "tests", "slic", ""], "setup": {"duration": 0.00014449609443545341, "outcome": "passed"}, "call": {"duration": 0.02873652521520853, "outcome": "failed", "crash": {"path": "/workspace/tligui_y/slic/tests/test_utils_elog.py", "lineno": 150, "message": "AssertionError: Message not found\nassert 'SCREENSHOT_INTEGRATION_TEST_MSG_456' in '\\n\\n\\nELOG Login\\n\\n\\n\\n\\n\\n\\n\\nPlease login\\n\\n\\nUsername\\n\\n\\n\\n\\nPassword\\n\\n\\n\\nKeep me logged in on this computer\\nfor the next 31 days or until I log out\\n\\nForgot password?\\n\\nELOG V3.1.5-1272bc14\\n'"}, "traceback": [{"path": "tests/test_utils_elog.py", "lineno": 150, "message": "AssertionError"}], "longrepr": "mock_screenshot_class = <MagicMock name='Screenshot' id='140371424262656'>\n\n @patch(\"slic.utils.elog.Screenshot\")\n def test_screenshot(mock_screenshot_class):\n fake_path = \"/tmp/fake_screenshot.png\"\n with open(fake_path, \"wb\") as f:\n f.write(b\"fake image data\")\n \n mock_instance = mock_screenshot_class.return_value\n mock_instance.shoot.return_value = [fake_path]\n \n elog = elog = Elog(\"http://localhost:8080/demo\", user=\"robot\", password=\"testpassword\")\n \n test_msg = \"SCREENSHOT_INTEGRATION_TEST_MSG_456\"\n elog.screenshot(message=test_msg)\n \n url = \"http://localhost:8080/demo/5\"\n response = requests.get(url)\n \n print(\"Texte bruuuut :\", response.content)\n \n soup = BeautifulSoup(response.content, 'html.parser')\n content = soup.get_text()\n \n print(\"Texte brut :\", content)\n \n filename = os.path.basename(fake_path)\n \n print(\"FILE NAME : \", filename)\n \n> assert test_msg in content, \"Message not found\"\nE AssertionError: Message not found\nE assert 'SCREENSHOT_INTEGRATION_TEST_MSG_456' in '\\n\\n\\nELOG Login\\n\\n\\n\\n\\n\\n\\n\\nPlease login\\n\\n\\nUsername\\n\\n\\n\\n\\nPassword\\n\\n\\n\\nKeep me logged in on this computer\\nfor the next 31 days or until I log out\\n\\nForgot password?\\n\\nELOG V3.1.5-1272bc14\\n'\n\ntests/test_utils_elog.py:150: AssertionError"}, "teardown": {"duration": 0.00023398501798510551, "outcome": "passed"}}], "warnings": [{"message": "invalid escape sequence \\-", "category": "DeprecationWarning", "when": "collect", "filename": "/workspace/tligui_y/slic/.pixi/envs/default/lib/python3.8/site-packages/bsread/h5.py", "lineno": 207}, {"message": "The module numpy.dual is deprecated. Instead of using dual, use the functions directly from numpy or scipy.", "category": "DeprecationWarning", "when": "collect", "filename": "/workspace/tligui_y/slic/.pixi/envs/default/lib/python3.8/site-packages/scipy/fft/__init__.py", "lineno": 97}]} |