kyu_6.string_transformer package

Submodules

kyu_6.string_transformer.string_transformer module

Test for -> String transformer.

Created by Egor Kostan. GitHub: https://github.com/ikostan

kyu_6.string_transformer.string_transformer.string_transformer(s: str) str[source]

Transform string.

Given a string, return a new string that has transformed based on the input:

1. Change case of every character, ie. lower case to upper case, upper case to lower case.

  1. Reverse the order of words from the input.

Note: You will have to handle multiple spaces, and leading/trailing spaces.

You may assume the input only contain English alphabet and spaces. :param s: str :return: str

kyu_6.string_transformer.test_string_transformer module

Solution for -> String transformer.

Created by Egor Kostan. GitHub: https://github.com/ikostan

class kyu_6.string_transformer.test_string_transformer.StringTransformerTestCase(methodName='runTest')[source]

Bases: TestCase

Testing string_transformer function.

_classSetupFailed = False
_class_cleanups = []
test_string_transformer = None
test_string_transformer_00_Example_string(**kw)

Testing string_transformer function with multiple test data [with s=’Example string’, expected=’STRING eXAMPLE’].

Given a string, return a new string that has transformed based on the input:

1. Change case of every character, ie. lower case to upper case, upper case to lower case.

2. Reverse the order of words from the input. :return:

test_string_transformer_01_Example_Input(**kw)

Testing string_transformer function with multiple test data [with s=’Example Input’, expected=’iNPUT eXAMPLE’].

Given a string, return a new string that has transformed based on the input:

1. Change case of every character, ie. lower case to upper case, upper case to lower case.

2. Reverse the order of words from the input. :return:

test_string_transformer_02_To_be_OR_not_to_be_That_is_the_Question(**kw)

Testing string_transformer function with multiple test data [with s=’To be OR not to be That is the Question’, expected=’qUESTION THE IS tHAT BE TO NOT or BE tO’].

Given a string, return a new string that has transformed based on the input:

1. Change case of every character, ie. lower case to upper case, upper case to lower case.

2. Reverse the order of words from the input. :return:

test_string_transformer_03_(**kw)

Testing string_transformer function with multiple test data [with s=’’, expected=’’].

Given a string, return a new string that has transformed based on the input:

1. Change case of every character, ie. lower case to upper case, upper case to lower case.

2. Reverse the order of words from the input. :return:

test_string_transformer_04_You_Know_When_THAT_Hotline_Bling(**kw)

Testing string_transformer function with multiple test data [with s=’You Know When THAT Hotline Bling’, expected=’bLING hOTLINE that wHEN kNOW yOU’].

Given a string, return a new string that has transformed based on the input:

1. Change case of every character, ie. lower case to upper case, upper case to lower case.

2. Reverse the order of words from the input. :return:

test_string_transformer_05__A_b_C_d_E_f_G_(**kw)

Testing string_transformer function with multiple test data [with s=’ A b C d E f G ‘, expected=’ g F e D c B a ‘].

Given a string, return a new string that has transformed based on the input:

1. Change case of every character, ie. lower case to upper case, upper case to lower case.

2. Reverse the order of words from the input. :return:

test_string_transformer_06_Alc_Rl_VLEE_k_xLU_c_c(**kw)

Testing string_transformer function with multiple test data [with s=’Alc Rl VLEE k xLU c c’, expected=’C C Xlu K vlee rL aLC’].

Given a string, return a new string that has transformed based on the input:

1. Change case of every character, ie. lower case to upper case, upper case to lower case.

2. Reverse the order of words from the input. :return:

test_string_transformer_07_J_VVmviAdpIAFzh_zs_oMHsx_HPvN_xt_sN_PlW_u_K_Q_XnV_mR_Betg_ox_E_j_cIiQ_Fa_GJdk_ECYzH_BkuU_(**kw)

Testing string_transformer function with multiple test data [with s=’J VVmviAdpIAFzh zs oMHsx HPvN … j cIiQ Fa GJdk ECYzH BkuU ‘, expected=’ bKUu ecyZh gjDK fA CiIq J … hpVn OmhSX ZS vvMVIaDPiafZH j’].

Given a string, return a new string that has transformed based on the input:

1. Change case of every character, ie. lower case to upper case, upper case to lower case.

2. Reverse the order of words from the input. :return:

test_string_transformer_08_LXOP_QmsZs_R_i_jUor_SWDkkhh_P_X_Q_H_vz_gD_KSpv_hGCOSB_e_e_r_piw_pXB_OqkIbb_(**kw)

Testing string_transformer function with multiple test data [with s=’LXOP QmsZs R i jUor SWDkkhh P…v hGCOSB e e r piw pXB OqkIbb ‘, expected=’ oQKiBB Pxb PIW R E E Hgcosb k…p swdKKHH JuOR I r qMSzS lxop’].

Given a string, return a new string that has transformed based on the input:

1. Change case of every character, ie. lower case to upper case, upper case to lower case.

2. Reverse the order of words from the input. :return:

test_string_transformer_09_V_Ots_Ev_k_Q_bC_jK_Db_cezl_YdmzzYbK_iu_JdJu_P_qeAwqZYewoHk_YnGdGQa_LoDorPaUom_cSJo_s(**kw)

Testing string_transformer function with multiple test data [with s=’V Ots Ev k Q bC jK Db cezl Ydm…ewoHk YnGdGQa LoDorPaUom cSJo s’, expected=’S CsjO lOdORpAuOM yNgDgqA QEaWQ…yBk CEZL dB Jk Bc q K eV oTS v’].

Given a string, return a new string that has transformed based on the input:

1. Change case of every character, ie. lower case to upper case, upper case to lower case.

2. Reverse the order of words from the input. :return:

test_string_transformer_10_KYjBc_SgkXrFIDq_MYv_XAEzh_RX_fkSPCF_tMtYN_ewyhq_EFSgia_DUH_u_vXizIYb_u_oZ_OMw_YjaqzJ_BJGjfOc_s(**kw)

Testing string_transformer function with multiple test data [with s=’KYjBc SgkXrFIDq MYv XAEzh RX f…IYb u oZ OMw YjaqzJ BJGjfOc s’, expected=’S bjgJFoC yJAQZj omW Oz U VxI…f rx xaeZH myV sGKxRfidQ kyJbC’].

Given a string, return a new string that has transformed based on the input:

1. Change case of every character, ie. lower case to upper case, upper case to lower case.

2. Reverse the order of words from the input. :return:

test_string_transformer_11_ncE_ZpQ_O_y_A_fBNbw_R_v_rCg_n_yhpvx_BMn_tk_ubCZrHJl_GiEyCjZcRk_kheNwWj_PA_ZAGpsZamNHb(**kw)

Testing string_transformer function with multiple test data [with s=’ncE ZpQ O y A fBNbw R v rCg …CjZcRk kheNwWj PA ZAGpsZamNHb’, expected=’zagPSzAMnhB pa KHEnWwJ gIeYcJ… RcG V r FbnBW a Y o zPq NCe’].

Given a string, return a new string that has transformed based on the input:

1. Change case of every character, ie. lower case to upper case, upper case to lower case.

2. Reverse the order of words from the input. :return:

test_string_transformer_12_UOtfi_erH_kCk_KXzg_Io_Y_I_TYAf_EGXVSvASIyJ_p_Zf_p_kV_g_RI_V(**kw)

Testing string_transformer function with multiple test data [with s=’UOtfi erH kCk KXzg Io Y I TY…f EGXVSvASIyJ p Zf p kV g RI V’, expected=’v ri G Kv P zF P egxvsVasiYj t…aF i y iO kxZG KcK ERh uoTFI’].

Given a string, return a new string that has transformed based on the input:

1. Change case of every character, ie. lower case to upper case, upper case to lower case.

2. Reverse the order of words from the input. :return:

Module contents

String transformer.