Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pins/rsconnect/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from collections.abc import Sequence
from dataclasses import asdict, dataclass, field, fields
from pathlib import Path
from typing import ClassVar

from fsspec import AbstractFileSystem

Expand Down Expand Up @@ -108,7 +107,7 @@ class BundleFilePath(BundlePath):


class RsConnectFs(AbstractFileSystem):
protocol: ClassVar[str | tuple[str, ...]] = "rsc"
protocol = "rsc"

def __init__(self, server_url, **kwargs):
if isinstance(server_url, RsConnectApi):
Expand Down
9 changes: 9 additions & 0 deletions pins/tests/test_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,12 @@ def test_version_from_files(bytes_):

assert v.hash == digest
assert v.created == EXAMPLE_DATE


def test_version_from_files_multiple():
files = [BytesIO(b"123"), BytesIO(b"456")]
v = Version.from_files(files, EXAMPLE_DATE)

combined = xxhash.xxh64(b"123").hexdigest() + xxhash.xxh64(b"456").hexdigest()
assert v.hash == xxhash.xxh64(combined.encode("utf-8")).hexdigest()
assert v.created == EXAMPLE_DATE
2 changes: 1 addition & 1 deletion pins/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def from_files(
combined_hashes = "".join(hashes)

# Create an xxh64 hash of the combined string
hashes = [xxh64(combined_hashes).hexdigest()]
hashes = [xxh64(combined_hashes.encode("utf-8")).hexdigest()]

return cls(created, hashes[0])

Expand Down
Loading