9
9
10
10
11
11
@pytest .mark .parametrize ("N" , (1 , 2 , 4 , 16 , 64 ))
12
- async def test_gready_cache_decorator (N : int , pgconn : asyncpg .Connection ) -> None :
12
+ async def test_greedy_cache_decorator (N : int , pgconn : asyncpg .Connection ) -> None :
13
13
statistics = collections .Counter [str ]()
14
14
listener = listeners .PGEventQueue ()
15
15
await listener .connect (pgconn , models .PGChannel ("test_cache_decorator" ))
16
16
17
17
@decorators .cache (
18
- strategy = strategies .Gready (listener = listener ),
18
+ strategy = strategies .Greedy (listener = listener ),
19
19
statistics_callback = lambda x : statistics .update ([x ]),
20
20
)
21
21
async def now () -> datetime .datetime :
@@ -29,18 +29,18 @@ async def now() -> datetime.datetime:
29
29
30
30
31
31
@pytest .mark .parametrize ("N" , (1 , 2 , 4 , 16 , 64 ))
32
- async def test_gready_cache_decorator_connection_closed (
32
+ async def test_greedy_cache_decorator_connection_closed (
33
33
N : int ,
34
34
pgconn : asyncpg .Connection ,
35
35
) -> None :
36
36
listener = listeners .PGEventQueue ()
37
37
await listener .connect (
38
38
pgconn ,
39
- models .PGChannel ("test_gready_cache_decorator_connection_closed " ),
39
+ models .PGChannel ("test_greedy_cache_decorator_connection_closed " ),
40
40
)
41
41
await pgconn .close ()
42
42
43
- @decorators .cache (strategy = strategies .Gready (listener = listener ))
43
+ @decorators .cache (strategy = strategies .Greedy (listener = listener ))
44
44
async def now () -> datetime .datetime :
45
45
return datetime .datetime .now ()
46
46
@@ -49,17 +49,17 @@ async def now() -> datetime.datetime:
49
49
50
50
51
51
@pytest .mark .parametrize ("N" , (1 , 2 , 4 , 16 , 64 ))
52
- async def test_gready_cache_decorator_exceptions (
52
+ async def test_greedy_cache_decorator_exceptions (
53
53
N : int ,
54
54
pgconn : asyncpg .Connection ,
55
55
) -> None :
56
56
listener = listeners .PGEventQueue ()
57
57
await listener .connect (
58
58
pgconn ,
59
- models .PGChannel ("test_gready_cache_decorator_exceptions " ),
59
+ models .PGChannel ("test_greedy_cache_decorator_exceptions " ),
60
60
)
61
61
62
- @decorators .cache (strategy = strategies .Gready (listener = listener ))
62
+ @decorators .cache (strategy = strategies .Greedy (listener = listener ))
63
63
async def raise_runtime_error () -> NoReturn :
64
64
raise RuntimeError
65
65
@@ -76,19 +76,19 @@ async def raise_runtime_error() -> NoReturn:
76
76
77
77
78
78
@pytest .mark .parametrize ("N" , (1 , 2 , 4 , 16 , 64 ))
79
- async def test_gready_cache_identity (
79
+ async def test_greedy_cache_identity (
80
80
N : int ,
81
81
pgconn : asyncpg .Connection ,
82
82
) -> None :
83
83
statistics = collections .Counter [str ]()
84
84
listener = listeners .PGEventQueue ()
85
85
await listener .connect (
86
86
pgconn ,
87
- models .PGChannel ("test_gready_cache_decorator_exceptions " ),
87
+ models .PGChannel ("test_greedy_cache_decorator_exceptions " ),
88
88
)
89
89
90
90
@decorators .cache (
91
- strategy = strategies .Gready (listener = listener ),
91
+ strategy = strategies .Greedy (listener = listener ),
92
92
statistics_callback = lambda x : statistics .update ([x ]),
93
93
)
94
94
async def identity (x : int ) -> int :
@@ -102,19 +102,19 @@ async def identity(x: int) -> int:
102
102
103
103
104
104
@pytest .mark .parametrize ("N" , (1 , 2 , 4 , 16 , 64 ))
105
- async def test_gready_cache_sleepy (
105
+ async def test_greedy_cache_sleepy (
106
106
N : int ,
107
107
pgconn : asyncpg .Connection ,
108
108
) -> None :
109
109
statistics = collections .Counter [str ]()
110
110
listener = listeners .PGEventQueue ()
111
111
await listener .connect (
112
112
pgconn ,
113
- models .PGChannel ("test_gready_cache_decorator_exceptions " ),
113
+ models .PGChannel ("test_greedy_cache_decorator_exceptions " ),
114
114
)
115
115
116
116
@decorators .cache (
117
- strategy = strategies .Gready (listener = listener ),
117
+ strategy = strategies .Greedy (listener = listener ),
118
118
statistics_callback = lambda x : statistics .update ([x ]),
119
119
)
120
120
async def now () -> datetime .datetime :
0 commit comments