# Path: pypinyin/pinyin_dict.py

# 
# Path: pypinyin/contrib/tone_convert.py



from pytest import mark
from pypinyin import pinyin_dict
from pypinyin.contrib.tone_convert import (
    tone_to_normal,
    tone_to_tone2,
    tone2_to_tone,
    tone_to_tone3,
    tone3_to_tone,
    tone2_to_normal,
    tone2_to_tone3,
    tone3_to_tone2,
    tone3_to_normal,
    to_normal,
    to_tone,
    to_tone2,
    to_tone3,
    to_initials,
    to_finals,
    to_finals_tone,
    to_finals_tone2,
    to_finals_tone3,
)
def test_tone_tone3(pinyin, result):
    assert tone_to_tone3(pinyin) == result
    assert to_tone3(pinyin) == result


@mark.parametrize('pinyin,neutral_tone_with_five,result', [
    ['shang', False, 'shang'],
    ['shang', True, 'shang5'],
])
def test_tone_tone3_with_neutral_tone_with_five(
        pinyin, neutral_tone_with_five, result):
    assert tone_to_tone3(
        pinyin, neutral_tone_with_five=neutral_tone_with_five) == result
    assert tone_to_tone3(
        pinyin, neutral_tone_with_5=neutral_tone_with_five) == result
    assert to_tone3(
        pinyin, neutral_tone_with_five=neutral_tone_with_five) == result
    assert to_tone3(
        pinyin, neutral_tone_with_5=neutral_tone_with_five) == result

    assert tone3_to_tone(result) == pinyin
    assert to_tone(result) == pinyin


@mark.parametrize('pinyin,v_to_u,result', [
    ['nǚ', False, 'nv3'],
    ['nǚ', True, 'nü3'],
    ['nv', True, 'nü'],
])
def test_tone_tone3_with_v_to_u(pinyin, v_to_u, result):

# Path: pypinyin/pinyin_dict.py

# 
# Path: pypinyin/contrib/tone_convert.py



# Path: tests/contrib/test_tone_convert.py
from pytest import mark
from pypinyin import pinyin_dict
from pypinyin.contrib.tone_convert import (
    tone_to_normal,
    tone_to_tone2,
    tone2_to_tone,
    tone_to_tone3,
    tone3_to_tone,
    tone2_to_normal,
    tone2_to_tone3,
    tone3_to_tone2,
    tone3_to_normal,
    to_normal,
    to_tone,
    to_tone2,
    to_tone3,
    to_initials,
    to_finals,
    to_finals_tone,
    to_finals_tone2,
    to_finals_tone3,
)

def test_tone_tone3(pinyin, result):
    assert tone_to_tone3(pinyin) == result
    assert to_tone3(pinyin) == result


@mark.parametrize('pinyin,neutral_tone_with_five,result', [
    ['shang', False, 'shang'],
    ['shang', True, 'shang5'],
])
def test_tone_tone3_with_neutral_tone_with_five(
        pinyin, neutral_tone_with_five, result):
    assert tone_to_tone3(
        pinyin, neutral_tone_with_five=neutral_tone_with_five) == result
    assert tone_to_tone3(
        pinyin, neutral_tone_with_5=neutral_tone_with_five) == result
    assert to_tone3(
        pinyin, neutral_tone_with_five=neutral_tone_with_five) == result
    assert to_tone3(
        pinyin, neutral_tone_with_5=neutral_tone_with_five) == result

    assert tone3_to_tone(result) == pinyin
    assert to_tone(result) == pinyin


@mark.parametrize('pinyin,v_to_u,result', [
    ['nǚ', False, 'nv3'],
    ['nǚ', True, 'nü3'],
    ['nv', True, 'nü'],
])
def test_tone_tone3_with_v_to_u(pinyin, v_to_u, result):

    assert tone_to_tone3(pinyin, v_to_u=v_to_u) == result