Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#1926)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/crate-ci/typos: typos-dict-v0.11.2 → v1.16.21](crate-ci/typos@typos-dict-v0.11.2...v1.16.21)
- [github.com/astral-sh/ruff-pre-commit: v0.1.1 → v0.1.3](astral-sh/ruff-pre-commit@v0.1.1...v0.1.3)
- [github.com/psf/black: 23.10.0 → 23.10.1](psf/black@23.10.0...23.10.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix comments after reformat

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: mrbean-bremen <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and mrbean-bremen authored Oct 30, 2023
1 parent 9113984 commit bdc9910
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/crate-ci/typos
rev: typos-dict-v0.11.2
rev: v1.16.21
hooks:
- id: typos
exclude: _.*_dict.py
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.1
rev: v0.1.3
hooks:
- id: ruff
args: [src, --fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 23.10.0
rev: 23.10.1
hooks:
- id: black
24 changes: 18 additions & 6 deletions tests/test_filewriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,9 @@ def test_write_empty_LO(self):
def test_write_DA(self):
data_elem = DataElement(0x00080022, "DA", "20000101")
expected = (
b"\x08\x00\x22\x00" b"\x08\x00\x00\x00" b"20000101" # tag # length
b"\x08\x00\x22\x00" # tag
b"\x08\x00\x00\x00" # length
b"20000101"
) # value
self.check_data_element(data_elem, expected)
data_elem = DataElement(0x00080022, "DA", date(2000, 1, 1))
Expand All @@ -458,7 +460,9 @@ def test_write_multi_DA(self):
def test_write_TM(self):
data_elem = DataElement(0x00080030, "TM", "010203")
expected = (
b"\x08\x00\x30\x00" b"\x06\x00\x00\x00" b"010203" # tag # length
b"\x08\x00\x30\x00" # tag
b"\x06\x00\x00\x00" # length
b"010203"
) # padded value
self.check_data_element(data_elem, expected)
data_elem = DataElement(0x00080030, "TM", b"010203")
Expand All @@ -469,7 +473,9 @@ def test_write_TM(self):
def test_write_multi_TM(self):
data_elem = DataElement(0x0014407C, "TM", ["082500", b"092655"])
expected = (
b"\x14\x00\x7C\x40" b"\x0E\x00\x00\x00" b"082500\\092655 " # tag # length
b"\x14\x00\x7C\x40" # tag
b"\x0E\x00\x00\x00" # length
b"082500\\092655 "
) # padded value
self.check_data_element(data_elem, expected)
data_elem = DataElement(0x0014407C, "TM", [time(8, 25), time(9, 26, 55)])
Expand All @@ -478,7 +484,9 @@ def test_write_multi_TM(self):
def test_write_DT(self):
data_elem = DataElement(0x0008002A, "DT", "20170101120000")
expected = (
b"\x08\x00\x2A\x00" b"\x0E\x00\x00\x00" b"20170101120000" # tag # length
b"\x08\x00\x2A\x00" # tag
b"\x0E\x00\x00\x00" # length
b"20170101120000"
) # value
self.check_data_element(data_elem, expected)
data_elem = DataElement(0x0008002A, "DT", b"20170101120000")
Expand Down Expand Up @@ -508,15 +516,19 @@ def test_write_multi_DT(self):

def test_write_ascii_vr_with_padding(self):
expected = (
b"\x08\x00\x54\x00" b"\x0C\x00\x00\x00" b"CONQUESTSRV " # tag # length
b"\x08\x00\x54\x00" # tag
b"\x0C\x00\x00\x00" # length
b"CONQUESTSRV "
) # padded value
data_elem = DataElement(0x00080054, "AE", "CONQUESTSRV")
self.check_data_element(data_elem, expected)
data_elem = DataElement(0x00080054, "AE", b"CONQUESTSRV")
self.check_data_element(data_elem, expected)

expected = (
b"\x08\x00\x62\x00" b"\x06\x00\x00\x00" b"1.2.3\x00" # tag # length
b"\x08\x00\x62\x00" # tag
b"\x06\x00\x00\x00" # length
b"1.2.3\x00"
) # padded value
data_elem = DataElement(0x00080062, "UI", "1.2.3")
self.check_data_element(data_elem, expected)
Expand Down

0 comments on commit bdc9910

Please sign in to comment.