Example #1
0
    def test_to_dict(self):
        # Arrange
        test_settings = Settings()

        # Act
        result = test_settings.to_dict()

        # Assert
        assert result == test_settings.__dict__
Example #2
0
def test_settingsfile_migration_content(tmpdir: pathlib.Path):
    # Arrange
    src = "/test_dir/tests/test_data/settings_old"
    dst = os.path.join(tmpdir, "settings")
    shutil.copyfile(src, dst)

    # Act
    result_settings = settings.read_settings_file(filepath=dst)
    settings_obj = Settings().from_dict(result_settings)
    clean_settings = settings.validate_settings(settings_obj.to_dict())

    # Assert
    assert isinstance(clean_settings, dict)
    assert "include" in result_settings