def test_addtional_charges_with_none_clearing(self): assert buildPrices('-', default='student', additional={ 'employee': '0.20€', 'others': 50 }) == {}
def test_build_from_custom_str_subtype(self): class CustomStr(str): pass assert buildPrices( CustomStr('3.64€'), default='student', ) == self.single_price_example
def test_addtional_charges(self): assert buildPrices(3.64, default='student', additional={ 'employee': '0.20€', 'others': 50 }) == self.price_example
def test_build_from_custom_float_subtype(self): class CustomFloat(float): pass assert buildPrices( CustomFloat(3.64), default='student', ) == self.single_price_example
def test_build_from_custom_int_subtype(self): class CustomInt(int): pass assert buildPrices( CustomInt(364), default='student', ) == self.single_price_example
def test_custom_dict_passthrough(self): class CustomDict(dict): pass d = CustomDict() d['student'] = 354 d['other'] = 375 assert buildPrices(d) == d
def test_build_from_prices_and_roles_with_custom_types(self): class CustomStr(str): pass class CustomFloat(float): pass class CustomInt(int): pass assert buildPrices( [CustomStr('3.64€'), CustomFloat(3.84), CustomInt(414)], ('student', 'employee', 'others') ) == self.price_example
def test_addtional_charges_with_none_clearing2(self): assert buildPrices(364, default='student', additional={ 'employee': '-', 'others': 50 }) == { 'student': 364, 'others': 414 }
def test_build_from_prices_and_roles_with_custom_types(self): class CustomStr(str): pass class CustomFloat(float): pass class CustomInt(int): pass assert buildPrices( [CustomStr('3.64€'), CustomFloat(3.84), CustomInt(414)], ('student', 'employee', 'others')) == self.price_example
def test_addtional_charges(self): assert buildPrices( 3.64, default='student', additional={'employee': '0.20€', 'others': 50} ) == self.price_example
def test_build_from_prices_and_roles_with_complete_none_clearing(self): assert buildPrices( ['-', '-', ' - '], ('student', 'employee', 'others') ) == {}
def test_build_from_prices_and_roles_with_none_clearing(self): assert buildPrices( ['3.64€', '-', ' - '], ('student', 'employee', 'others') ) == self.single_price_example
def test_build_from_prices_and_roles(self): assert buildPrices( ['3.64€', 3.84, 414], ('student', 'employee', 'others') ) == self.price_example
def test_dict_converting_with_complete_none_clearing(self): d = { 'student': '-', 'other': ' - ' } assert buildPrices(d) == {}
def test_dict_type_converting(self): d = {'student': '3.64 €', 'employee': 3.84, 'others': 414} assert buildPrices(d) == self.price_example
def test_build_from_prices_and_roles_with_complete_none_clearing(self): assert buildPrices(['-', '-', ' - '], ('student', 'employee', 'others')) == {}
def test_addtional_charges_with_none_clearing(self): assert buildPrices( '-', default='student', additional={'employee': '0.20€', 'others': 50} ) == {}
def test_dict_converting_with_complete_none_clearing(self): d = {'student': '-', 'other': ' - '} assert buildPrices(d) == {}
def test_build_from_prices_and_roles(self): assert buildPrices( ['3.64€', 3.84, 414], ('student', 'employee', 'others')) == self.price_example
def test_addtional_charges_with_none_clearing2(self): assert buildPrices( 364, default='student', additional={'employee': '-', 'others': 50} ) == {'student': 364, 'others': 414}
def test_build_from_prices_and_roles_with_none_clearing(self): assert buildPrices( ['3.64€', '-', ' - '], ('student', 'employee', 'others')) == self.single_price_example
def test_wrong_price_types(self): with pytest.raises(TypeError): buildPrices(True) with pytest.raises(TypeError): buildPrices(None)
def test_dict_passthrought(self): d = { 'student': 354, 'other': 375 } assert buildPrices(d) == d
def test_dict_passthrought(self): d = {'student': 354, 'other': 375} assert buildPrices(d) == d