11from string .templatelib import Interpolation
22
3- from .utils import convert , format_interpolation
3+ from .utils import base_format_interpolation , convert
44
55
66class Convertible :
@@ -32,50 +32,50 @@ def test_convert_s():
3232 assert convert (value , "s" ) == "Convertible str"
3333
3434
35- def test_format_interpolation_no_formatting ():
35+ def test_base_format_interpolation_no_formatting ():
3636 value = Convertible ()
3737 interp = Interpolation (value , expression = "" , conversion = None , format_spec = "" )
38- assert format_interpolation (interp ) is value
38+ assert base_format_interpolation (interp ) is value
3939
4040
41- def test_format_interpolation_a ():
41+ def test_base_format_interpolation_a ():
4242 value = Convertible ()
4343 interp = Interpolation (value , expression = "" , conversion = "a" , format_spec = "" )
44- assert format_interpolation (interp ) == "Convertible repr"
44+ assert base_format_interpolation (interp ) == "Convertible repr"
4545
4646
47- def test_format_interpolation_r ():
47+ def test_base_format_interpolation_r ():
4848 value = Convertible ()
4949 interp = Interpolation (value , expression = "" , conversion = "r" , format_spec = "" )
50- assert format_interpolation (interp ) == "Convertible repr"
50+ assert base_format_interpolation (interp ) == "Convertible repr"
5151
5252
53- def test_format_interpolation_s ():
53+ def test_base_format_interpolation_s ():
5454 value = Convertible ()
5555 interp = Interpolation (value , expression = "" , conversion = "s" , format_spec = "" )
56- assert format_interpolation (interp ) == "Convertible str"
56+ assert base_format_interpolation (interp ) == "Convertible str"
5757
5858
59- def test_format_interpolation_default_formatting ():
59+ def test_base_format_interpolation_default_formatting ():
6060 value = 42
6161 interp = Interpolation (value , expression = "" , conversion = None , format_spec = "5d" )
62- assert format_interpolation (interp ) == " 42"
62+ assert base_format_interpolation (interp ) == " 42"
6363
6464
65- def test_format_interpolation_custom_formatter_match_exact ():
65+ def test_base_format_interpolation_custom_formatter_match_exact ():
6666 value = 42
6767 interp = Interpolation (value , expression = "" , conversion = None , format_spec = "custom" )
6868
6969 def formatter (val : object , spec : str ) -> str :
7070 return f"formatted-{ val } -{ spec } "
7171
7272 assert (
73- format_interpolation (interp , formatters = [("custom" , formatter )])
73+ base_format_interpolation (interp , formatters = [("custom" , formatter )])
7474 == "formatted-42-custom"
7575 )
7676
7777
78- def test_format_interpolation_custom_formatter_match_predicate ():
78+ def test_base_format_interpolation_custom_formatter_match_predicate ():
7979 value = 42
8080 interp = Interpolation (
8181 value , expression = "" , conversion = None , format_spec = "custom123"
@@ -88,6 +88,6 @@ def formatter(val: object, spec: str) -> str:
8888 return f"formatted-{ val } -{ spec } "
8989
9090 assert (
91- format_interpolation (interp , formatters = [(matcher , formatter )])
91+ base_format_interpolation (interp , formatters = [(matcher , formatter )])
9292 == "formatted-42-custom123"
9393 )
0 commit comments