aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatias Linares <matias.linares@comprandoengrupo.net>2025-02-25 17:05:51 -0300
committerMatias Linares <matias.linares@comprandoengrupo.net>2025-02-27 11:57:57 -0300
commit265a1db778542623e42f1b35857579c25160df88 (patch)
tree8696da64c52d8b15b21c3a442b9fc8c4747134aa /tests
parentc5f854946a40b1ec278dfa999b3aaba9109dfc42 (diff)
downloadkodereviewer-265a1db778542623e42f1b35857579c25160df88.tar.gz
Add reviewer dialog and begin new diff views
Diffstat (limited to 'tests')
-rw-r--r--tests/__init__.py0
-rw-r--r--tests/diff_parser_tests.py22
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/__init__.py
diff --git a/tests/diff_parser_tests.py b/tests/diff_parser_tests.py
new file mode 100644
index 0000000..023430e
--- /dev/null
+++ b/tests/diff_parser_tests.py
@@ -0,0 +1,22 @@
+from kodereviewer.diff_parser import Hunk
+
+
+class TestHunk:
+ def test_parse_header(self):
+ hunk = Hunk('@@ -13,10 +13,15 @@ on:')
+
+ assert hunk.original_start_line == 13
+ assert hunk.original_line_count == 10
+ assert hunk.new_start_line == 13
+ assert hunk.new_line_count == 15
+ assert hunk.context == 'on:'
+
+ def test_parse_hunk_different_lines(self):
+ hunk = Hunk('@@ -68,5 +81,10 @@ jobs:')
+
+ assert hunk.original_start_line == 68
+ assert hunk.original_line_count == 5
+
+ assert hunk.new_start_line == 81
+ assert hunk.new_line_count == 10
+