Skip to content

Commit 1b19450

Browse files
committed
Ensure consistent path in snapshot tests
1 parent 617f0ac commit 1b19450

File tree

2 files changed

+160
-2
lines changed

2 files changed

+160
-2
lines changed

tests/snapshot_tests/__snapshots__/test_snapshots.ambr

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6009,6 +6009,164 @@
60096009

60106010
'''
60116011
# ---
6012+
# name: test_property_align
6013+
'''
6014+
<svg class="rich-terminal" viewBox="0 0 994 635.5999999999999" xmlns="http://www.w3.org/2000/svg">
6015+
<!-- Generated with Rich https://www.textualize.io -->
6016+
<style>
6017+
6018+
@font-face {
6019+
font-family: "Fira Code";
6020+
src: local("FiraCode-Regular"),
6021+
url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Regular.woff2") format("woff2"),
6022+
url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Regular.woff") format("woff");
6023+
font-style: normal;
6024+
font-weight: 400;
6025+
}
6026+
@font-face {
6027+
font-family: "Fira Code";
6028+
src: local("FiraCode-Bold"),
6029+
url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Bold.woff2") format("woff2"),
6030+
url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Bold.woff") format("woff");
6031+
font-style: bold;
6032+
font-weight: 700;
6033+
}
6034+
6035+
.terminal-4107518032-matrix {
6036+
font-family: Fira Code, monospace;
6037+
font-size: 20px;
6038+
line-height: 24.4px;
6039+
font-variant-east-asian: full-width;
6040+
}
6041+
6042+
.terminal-4107518032-title {
6043+
font-size: 18px;
6044+
font-weight: bold;
6045+
font-family: arial;
6046+
}
6047+
6048+
.terminal-4107518032-r1 { fill: #e1e1e1 }
6049+
.terminal-4107518032-r2 { fill: #c5c8c6 }
6050+
.terminal-4107518032-r3 { fill: #ffffff }
6051+
.terminal-4107518032-r4 { fill: #e5f2e5 }
6052+
.terminal-4107518032-r5 { fill: #e5f2e5;font-weight: bold }
6053+
</style>
6054+
6055+
<defs>
6056+
<clipPath id="terminal-4107518032-clip-terminal">
6057+
<rect x="0" y="0" width="975.0" height="584.5999999999999" />
6058+
</clipPath>
6059+
<clipPath id="terminal-4107518032-line-0">
6060+
<rect x="0" y="1.5" width="976" height="24.65"/>
6061+
</clipPath>
6062+
<clipPath id="terminal-4107518032-line-1">
6063+
<rect x="0" y="25.9" width="976" height="24.65"/>
6064+
</clipPath>
6065+
<clipPath id="terminal-4107518032-line-2">
6066+
<rect x="0" y="50.3" width="976" height="24.65"/>
6067+
</clipPath>
6068+
<clipPath id="terminal-4107518032-line-3">
6069+
<rect x="0" y="74.7" width="976" height="24.65"/>
6070+
</clipPath>
6071+
<clipPath id="terminal-4107518032-line-4">
6072+
<rect x="0" y="99.1" width="976" height="24.65"/>
6073+
</clipPath>
6074+
<clipPath id="terminal-4107518032-line-5">
6075+
<rect x="0" y="123.5" width="976" height="24.65"/>
6076+
</clipPath>
6077+
<clipPath id="terminal-4107518032-line-6">
6078+
<rect x="0" y="147.9" width="976" height="24.65"/>
6079+
</clipPath>
6080+
<clipPath id="terminal-4107518032-line-7">
6081+
<rect x="0" y="172.3" width="976" height="24.65"/>
6082+
</clipPath>
6083+
<clipPath id="terminal-4107518032-line-8">
6084+
<rect x="0" y="196.7" width="976" height="24.65"/>
6085+
</clipPath>
6086+
<clipPath id="terminal-4107518032-line-9">
6087+
<rect x="0" y="221.1" width="976" height="24.65"/>
6088+
</clipPath>
6089+
<clipPath id="terminal-4107518032-line-10">
6090+
<rect x="0" y="245.5" width="976" height="24.65"/>
6091+
</clipPath>
6092+
<clipPath id="terminal-4107518032-line-11">
6093+
<rect x="0" y="269.9" width="976" height="24.65"/>
6094+
</clipPath>
6095+
<clipPath id="terminal-4107518032-line-12">
6096+
<rect x="0" y="294.3" width="976" height="24.65"/>
6097+
</clipPath>
6098+
<clipPath id="terminal-4107518032-line-13">
6099+
<rect x="0" y="318.7" width="976" height="24.65"/>
6100+
</clipPath>
6101+
<clipPath id="terminal-4107518032-line-14">
6102+
<rect x="0" y="343.1" width="976" height="24.65"/>
6103+
</clipPath>
6104+
<clipPath id="terminal-4107518032-line-15">
6105+
<rect x="0" y="367.5" width="976" height="24.65"/>
6106+
</clipPath>
6107+
<clipPath id="terminal-4107518032-line-16">
6108+
<rect x="0" y="391.9" width="976" height="24.65"/>
6109+
</clipPath>
6110+
<clipPath id="terminal-4107518032-line-17">
6111+
<rect x="0" y="416.3" width="976" height="24.65"/>
6112+
</clipPath>
6113+
<clipPath id="terminal-4107518032-line-18">
6114+
<rect x="0" y="440.7" width="976" height="24.65"/>
6115+
</clipPath>
6116+
<clipPath id="terminal-4107518032-line-19">
6117+
<rect x="0" y="465.1" width="976" height="24.65"/>
6118+
</clipPath>
6119+
<clipPath id="terminal-4107518032-line-20">
6120+
<rect x="0" y="489.5" width="976" height="24.65"/>
6121+
</clipPath>
6122+
<clipPath id="terminal-4107518032-line-21">
6123+
<rect x="0" y="513.9" width="976" height="24.65"/>
6124+
</clipPath>
6125+
<clipPath id="terminal-4107518032-line-22">
6126+
<rect x="0" y="538.3" width="976" height="24.65"/>
6127+
</clipPath>
6128+
</defs>
6129+
6130+
<rect fill="#292929" stroke="rgba(255,255,255,0.35)" stroke-width="1" x="1" y="1" width="992" height="633.6" rx="8"/><text class="terminal-4107518032-title" fill="#c5c8c6" text-anchor="middle" x="496" y="27">AlignApp</text>
6131+
<g transform="translate(26,22)">
6132+
<circle cx="0" cy="0" r="7" fill="#ff5f57"/>
6133+
<circle cx="22" cy="0" r="7" fill="#febc2e"/>
6134+
<circle cx="44" cy="0" r="7" fill="#28c840"/>
6135+
</g>
6136+
6137+
<g transform="translate(9, 41)" clip-path="url(#terminal-4107518032-clip-terminal)">
6138+
<rect fill="#1e1e1e" x="0" y="1.5" width="976" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="25.9" width="976" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="50.3" width="976" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="74.7" width="976" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="99.1" width="976" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="123.5" width="976" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="147.9" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="244" y="147.9" width="488" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="732" y="147.9" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="172.3" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="244" y="172.3" width="12.2" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="256.2" y="172.3" width="463.6" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="719.8" y="172.3" width="12.2" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="732" y="172.3" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="196.7" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="244" y="196.7" width="12.2" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="256.2" y="196.7" width="12.2" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="268.4" y="196.7" width="292.8" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="561.2" y="196.7" width="85.4" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="646.6" y="196.7" width="73.2" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="719.8" y="196.7" width="12.2" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="732" y="196.7" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="221.1" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="244" y="221.1" width="12.2" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="256.2" y="221.1" width="463.6" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="719.8" y="221.1" width="12.2" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="732" y="221.1" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="245.5" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="244" y="245.5" width="488" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="732" y="245.5" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="269.9" width="976" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="294.3" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="244" y="294.3" width="488" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="732" y="294.3" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="318.7" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="244" y="318.7" width="12.2" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="256.2" y="318.7" width="463.6" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="719.8" y="318.7" width="12.2" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="732" y="318.7" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="343.1" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="244" y="343.1" width="12.2" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="256.2" y="343.1" width="12.2" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="268.4" y="343.1" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="512.4" y="343.1" width="207.4" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="719.8" y="343.1" width="12.2" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="732" y="343.1" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="367.5" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="244" y="367.5" width="12.2" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="256.2" y="367.5" width="463.6" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="719.8" y="367.5" width="12.2" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="732" y="367.5" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="391.9" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#008000" x="244" y="391.9" width="488" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="732" y="391.9" width="244" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="416.3" width="976" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="440.7" width="976" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="465.1" width="976" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="489.5" width="976" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="513.9" width="976" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="538.3" width="976" height="24.65" shape-rendering="crispEdges"/><rect fill="#1e1e1e" x="0" y="562.7" width="976" height="24.65" shape-rendering="crispEdges"/>
6139+
<g class="terminal-4107518032-matrix">
6140+
<text class="terminal-4107518032-r2" x="976" y="20" textLength="12.2" clip-path="url(#terminal-4107518032-line-0)">
6141+
</text><text class="terminal-4107518032-r2" x="976" y="44.4" textLength="12.2" clip-path="url(#terminal-4107518032-line-1)">
6142+
</text><text class="terminal-4107518032-r2" x="976" y="68.8" textLength="12.2" clip-path="url(#terminal-4107518032-line-2)">
6143+
</text><text class="terminal-4107518032-r2" x="976" y="93.2" textLength="12.2" clip-path="url(#terminal-4107518032-line-3)">
6144+
</text><text class="terminal-4107518032-r2" x="976" y="117.6" textLength="12.2" clip-path="url(#terminal-4107518032-line-4)">
6145+
</text><text class="terminal-4107518032-r2" x="976" y="142" textLength="12.2" clip-path="url(#terminal-4107518032-line-5)">
6146+
</text><text class="terminal-4107518032-r3" x="244" y="166.4" textLength="488" clip-path="url(#terminal-4107518032-line-6)">┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓</text><text class="terminal-4107518032-r2" x="976" y="166.4" textLength="12.2" clip-path="url(#terminal-4107518032-line-6)">
6147+
</text><text class="terminal-4107518032-r3" x="244" y="190.8" textLength="12.2" clip-path="url(#terminal-4107518032-line-7)">┃</text><text class="terminal-4107518032-r3" x="719.8" y="190.8" textLength="12.2" clip-path="url(#terminal-4107518032-line-7)">┃</text><text class="terminal-4107518032-r2" x="976" y="190.8" textLength="12.2" clip-path="url(#terminal-4107518032-line-7)">
6148+
</text><text class="terminal-4107518032-r3" x="244" y="215.2" textLength="12.2" clip-path="url(#terminal-4107518032-line-8)">┃</text><text class="terminal-4107518032-r4" x="268.4" y="215.2" textLength="292.8" clip-path="url(#terminal-4107518032-line-8)">Vertical&#160;alignment&#160;with&#160;</text><text class="terminal-4107518032-r5" x="561.2" y="215.2" textLength="85.4" clip-path="url(#terminal-4107518032-line-8)">Textual</text><text class="terminal-4107518032-r3" x="719.8" y="215.2" textLength="12.2" clip-path="url(#terminal-4107518032-line-8)">┃</text><text class="terminal-4107518032-r2" x="976" y="215.2" textLength="12.2" clip-path="url(#terminal-4107518032-line-8)">
6149+
</text><text class="terminal-4107518032-r3" x="244" y="239.6" textLength="12.2" clip-path="url(#terminal-4107518032-line-9)">┃</text><text class="terminal-4107518032-r3" x="719.8" y="239.6" textLength="12.2" clip-path="url(#terminal-4107518032-line-9)">┃</text><text class="terminal-4107518032-r2" x="976" y="239.6" textLength="12.2" clip-path="url(#terminal-4107518032-line-9)">
6150+
</text><text class="terminal-4107518032-r3" x="244" y="264" textLength="488" clip-path="url(#terminal-4107518032-line-10)">┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛</text><text class="terminal-4107518032-r2" x="976" y="264" textLength="12.2" clip-path="url(#terminal-4107518032-line-10)">
6151+
</text><text class="terminal-4107518032-r2" x="976" y="288.4" textLength="12.2" clip-path="url(#terminal-4107518032-line-11)">
6152+
</text><text class="terminal-4107518032-r3" x="244" y="312.8" textLength="488" clip-path="url(#terminal-4107518032-line-12)">┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓</text><text class="terminal-4107518032-r2" x="976" y="312.8" textLength="12.2" clip-path="url(#terminal-4107518032-line-12)">
6153+
</text><text class="terminal-4107518032-r3" x="244" y="337.2" textLength="12.2" clip-path="url(#terminal-4107518032-line-13)">┃</text><text class="terminal-4107518032-r3" x="719.8" y="337.2" textLength="12.2" clip-path="url(#terminal-4107518032-line-13)">┃</text><text class="terminal-4107518032-r2" x="976" y="337.2" textLength="12.2" clip-path="url(#terminal-4107518032-line-13)">
6154+
</text><text class="terminal-4107518032-r3" x="244" y="361.6" textLength="12.2" clip-path="url(#terminal-4107518032-line-14)">┃</text><text class="terminal-4107518032-r4" x="268.4" y="361.6" textLength="244" clip-path="url(#terminal-4107518032-line-14)">Take&#160;note,&#160;browsers.</text><text class="terminal-4107518032-r3" x="719.8" y="361.6" textLength="12.2" clip-path="url(#terminal-4107518032-line-14)">┃</text><text class="terminal-4107518032-r2" x="976" y="361.6" textLength="12.2" clip-path="url(#terminal-4107518032-line-14)">
6155+
</text><text class="terminal-4107518032-r3" x="244" y="386" textLength="12.2" clip-path="url(#terminal-4107518032-line-15)">┃</text><text class="terminal-4107518032-r3" x="719.8" y="386" textLength="12.2" clip-path="url(#terminal-4107518032-line-15)">┃</text><text class="terminal-4107518032-r2" x="976" y="386" textLength="12.2" clip-path="url(#terminal-4107518032-line-15)">
6156+
</text><text class="terminal-4107518032-r3" x="244" y="410.4" textLength="488" clip-path="url(#terminal-4107518032-line-16)">┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛</text><text class="terminal-4107518032-r2" x="976" y="410.4" textLength="12.2" clip-path="url(#terminal-4107518032-line-16)">
6157+
</text><text class="terminal-4107518032-r2" x="976" y="434.8" textLength="12.2" clip-path="url(#terminal-4107518032-line-17)">
6158+
</text><text class="terminal-4107518032-r2" x="976" y="459.2" textLength="12.2" clip-path="url(#terminal-4107518032-line-18)">
6159+
</text><text class="terminal-4107518032-r2" x="976" y="483.6" textLength="12.2" clip-path="url(#terminal-4107518032-line-19)">
6160+
</text><text class="terminal-4107518032-r2" x="976" y="508" textLength="12.2" clip-path="url(#terminal-4107518032-line-20)">
6161+
</text><text class="terminal-4107518032-r2" x="976" y="532.4" textLength="12.2" clip-path="url(#terminal-4107518032-line-21)">
6162+
</text><text class="terminal-4107518032-r2" x="976" y="556.8" textLength="12.2" clip-path="url(#terminal-4107518032-line-22)">
6163+
</text>
6164+
</g>
6165+
</g>
6166+
</svg>
6167+
6168+
'''
6169+
# ---
60126170
# name: test_vertical_layout
60136171
'''
60146172
<svg class="rich-terminal" viewBox="0 0 994 635.5999999999999" xmlns="http://www.w3.org/2000/svg">

tests/snapshot_tests/test_snapshots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pathlib import Path
1+
from pathlib import Path, PurePosixPath
22

33
import pytest
44

@@ -94,7 +94,7 @@ def test_header_render(snap_compare):
9494
# If any of these change, something has likely broken, so snapshot each of them.
9595

9696
PATHS = [
97-
str(path) for path in Path("docs/examples/styles").iterdir() if path.suffix == ".py"
97+
str(PurePosixPath(path)) for path in Path("docs/examples/styles").iterdir() if path.suffix == ".py"
9898
]
9999

100100

0 commit comments

Comments
 (0)