Skip to content

Commit f8034bc

Browse files
fixtures refactor
1 parent 7cd305a commit f8034bc

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

tests/fixtures.bash

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ grouping,product,description,reference,quantity,from,until,condition,unit,extern
55
CSV
66
}
77

8-
fixture_assets() {
8+
stage_assets() {
99
mkdir -p "$1/providers/hetzner"
1010
cp "$ROOT/schema.sql" "$ROOT/audit.sql" "$1/"
11+
}
12+
13+
fixture_assets() {
14+
stage_assets "$1"
1115
cat > "$1/providers/hetzner/prices.csv" <<CSV
1216
type,price_group,currency,effective_from,price_hourly,price_monthly
1317
cx33,eu,eur,2025-10-01,0.0080,4.99
@@ -29,8 +33,7 @@ CSV
2933
}
3034

3135
rounding_assets() {
32-
mkdir -p "$1/providers/hetzner"
33-
cp "$ROOT/schema.sql" "$ROOT/audit.sql" "$1/"
36+
stage_assets "$1"
3437
cat > "$1/providers/hetzner/prices.csv" <<CSV
3538
type,price_group,currency,effective_from,price_hourly,price_monthly
3639
cx33,eu,eur,2025-10-01,0.0160,10.00
@@ -59,8 +62,7 @@ CSV
5962
}
6063

6164
jun2026_assets() {
62-
mkdir -p "$1/providers/hetzner"
63-
cp "$ROOT/schema.sql" "$ROOT/audit.sql" "$1/"
65+
stage_assets "$1"
6466
cat > "$1/providers/hetzner/prices.csv" <<CSV
6567
type,price_group,currency,effective_from,price_hourly,price_monthly
6668
cpx31,eu,eur,2026-04-01,0.0336,20.99
@@ -103,8 +105,7 @@ CSV
103105
}
104106

105107
jun2026_scaleup_assets() {
106-
mkdir -p "$1/providers/hetzner"
107-
cp "$ROOT/schema.sql" "$ROOT/audit.sql" "$1/"
108+
stage_assets "$1"
108109
cat > "$1/providers/hetzner/prices.csv" <<CSV
109110
type,price_group,currency,effective_from,price_hourly,price_monthly
110111
cx33,eu,eur,2025-10-01,0.0080,4.99
@@ -135,8 +136,7 @@ CSV
135136
}
136137

137138
jun2026_reprice_assets() {
138-
mkdir -p "$1/providers/hetzner"
139-
cp "$ROOT/schema.sql" "$ROOT/audit.sql" "$1/"
139+
stage_assets "$1"
140140
cat > "$1/providers/hetzner/prices.csv" <<CSV
141141
type,price_group,currency,effective_from,price_hourly,price_monthly
142142
cx33,eu,eur,2025-10-01,0.0080,4.99
@@ -158,8 +158,7 @@ CSV
158158
}
159159

160160
jun2026_resize_assets() {
161-
mkdir -p "$1/providers/hetzner"
162-
cp "$ROOT/schema.sql" "$ROOT/audit.sql" "$1/"
161+
stage_assets "$1"
163162
cat > "$1/providers/hetzner/prices.csv" <<CSV
164163
type,price_group,currency,effective_from,price_hourly,price_monthly
165164
cx22,eu,eur,2026-04-01,0.0060,3.79
@@ -181,8 +180,7 @@ CSV
181180
}
182181

183182
jun2026_solo_assets() {
184-
mkdir -p "$1/providers/hetzner"
185-
cp "$ROOT/schema.sql" "$ROOT/audit.sql" "$1/"
183+
stage_assets "$1"
186184
cat > "$1/providers/hetzner/prices.csv" <<CSV
187185
type,price_group,currency,effective_from,price_hourly,price_monthly
188186
cpx31,eu,eur,2026-04-01,0.0336,20.99

0 commit comments

Comments
 (0)