def test_negative_scalar_index(adata, index: int, obs: bool):
    pos_index = index + (adata.n_obs if obs else adata.n_vars)

    if obs:
        adata_pos_subset = adata[pos_index]
        adata_neg_subset = adata[index]
    else:
        adata_pos_subset = adata[:, pos_index]
        adata_neg_subset = adata[:, index]

    np.testing.assert_array_equal(
        adata_pos_subset.obs_names, adata_neg_subset.obs_names
    )
    np.testing.assert_array_equal(
        adata_pos_subset.var_names, adata_neg_subset.var_names
    )
def test_parse_section_body():
    output_section = {
        'action_template': '    task',
        'sources_repls': 'source',
        'variable': '6',
        'target_pattern': 'target',
    }
    assert mariofile.parse_section_body(SECTION.splitlines(True)) == output_section
    with pytest.raises(mariofile.ConfigurationFileError):
        mariofile.parse_section_body(SECTION_MULTIPLE_RULE.splitlines(True))
    with pytest.raises(mariofile.ConfigurationFileError):
        mariofile.parse_section_body(INVALID_CONFIG.splitlines(True))