Skip to content

Commit

Permalink
Split test file into two
Browse files Browse the repository at this point in the history
  • Loading branch information
willingc authored and lwasser committed Mar 8, 2024
1 parent 5256f04 commit 7b9ef86
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
"""
Tests for the clean and parse helper functions located in
the utils_clean and utils_parse modules.
"""
"""Tests for the clean helper functions located in the utils_clean module."""

import pytest

from pyosmeta.utils_clean import clean_date, clean_markdown, clean_name
from pyosmeta.utils_parse import parse_user_names


@pytest.mark.parametrize(
Expand Down Expand Up @@ -60,22 +55,3 @@ def test_clean_markdown(input_string, expected_output):
)
def test_clean_name(input_name, expected_output):
assert clean_name(input_name) == expected_output


@pytest.mark.parametrize(
"name, expected_result",
[
(
"Test User (@test1user)",
{"name": "Test User", "github_username": "test1user"},
),
("(@test2user)", {"name": "", "github_username": "test2user"}),
(
"Test (user) 3 (@test3user)",
{"name": "Test user 3", "github_username": "test3user"},
),
("@test4user", {"name": "", "github_username": "test4user"}),
],
)
def test_parse_user_names(name, expected_result):
assert parse_user_names(name) == expected_result
24 changes: 24 additions & 0 deletions tests/unit/test_utils_parse.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Tests for parse helper functions located in utils_parse module."""

import pytest

from pyosmeta.utils_parse import parse_user_names


@pytest.mark.parametrize(
"name, expected_result",
[
(
"Test User (@test1user)",
{"name": "Test User", "github_username": "test1user"},
),
("(@test2user)", {"name": "", "github_username": "test2user"}),
(
"Test (user) 3 (@test3user)",
{"name": "Test user 3", "github_username": "test3user"},
),
("@test4user", {"name": "", "github_username": "test4user"}),
],
)
def test_parse_user_names(name, expected_result):
assert parse_user_names(name) == expected_result

0 comments on commit 7b9ef86

Please sign in to comment.