r""" Create the object of the 'ParamQuantEstimation' class. Load and then clear reference data.
(tmp_path)
| 539 | |
| 540 | |
| 541 | def test_ParamQuantEstimation_1(tmp_path): |
| 542 | r""" |
| 543 | Create the object of the 'ParamQuantEstimation' class. Load and then clear reference data. |
| 544 | """ |
| 545 | |
| 546 | # 'home_dir' is typically '~', but for testing it is set to 'tmp_dir' |
| 547 | home_dir = tmp_path |
| 548 | config_dir = ".pyxrf" |
| 549 | standards_fln = "quantitative_standards.yaml" |
| 550 | |
| 551 | pqe = ParamQuantEstimation(home_dir=home_dir) |
| 552 | |
| 553 | # Verify that the cofig file was created |
| 554 | file_path = os.path.join(home_dir, config_dir, standards_fln) |
| 555 | assert os.path.isfile( |
| 556 | file_path |
| 557 | ), f"Empty file for user-defined reference standards '{file_path}' was not created" |
| 558 | |
| 559 | # Load reference standards |
| 560 | pqe.load_standards() |
| 561 | assert pqe.standards_built_in is not None, "Failed to load built-in standards" |
| 562 | assert pqe.standards_custom is not None, "Failed to load user-defined standards" |
| 563 | |
| 564 | # Clear loaded standards |
| 565 | pqe.clear_standards() |
| 566 | assert pqe.standards_built_in is None, "Failed to clear loaded built-in standards" |
| 567 | assert pqe.standards_custom is None, "Failed to clear loaded user-defined standards" |
| 568 | |
| 569 | |
| 570 | def test_ParamQuantEstimation_2(tmp_path): |
nothing calls this directly
no test coverage detected