-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from p12tic/accept-multiple-dots-filenames
Accept multiple dots in filenames
- Loading branch information
Showing
4 changed files
with
106 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Accept newsfragment filenames with multiple dots, like `fix-1.2.3.bugfix`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright (c) Povilas Kanapickas, 2019 | ||
# See LICENSE for details. | ||
|
||
from twisted.trial.unittest import TestCase | ||
|
||
from .._builder import parse_newfragment_basename | ||
|
||
|
||
class TestParseNewsfragmentBasename(TestCase): | ||
|
||
def test_simple(self): | ||
self.assertEqual(parse_newfragment_basename('123.feature', ['feature']), | ||
('123', 'feature', 0)) | ||
|
||
def test_counter(self): | ||
self.assertEqual(parse_newfragment_basename('123.feature.1', | ||
['feature']), | ||
('123', 'feature', 1)) | ||
|
||
def test_ignores_extension(self): | ||
self.assertEqual(parse_newfragment_basename('123.feature.ext', | ||
['feature']), | ||
('123', 'feature', 0)) | ||
|
||
def test_non_numeric_ticket(self): | ||
self.assertEqual(parse_newfragment_basename('baz.feature', | ||
['feature']), | ||
('baz', 'feature', 0)) | ||
|
||
def test_dots_in_ticket_name(self): | ||
self.assertEqual(parse_newfragment_basename('baz.1.2.feature', | ||
['feature']), | ||
('2', 'feature', 0)) | ||
|
||
def test_dots_in_ticket_name_unknown_category(self): | ||
self.assertEqual(parse_newfragment_basename('baz.1.2.notfeature', | ||
['feature']), | ||
('1', '2', 0)) | ||
|
||
def test_dots_in_ticket_name_and_counter(self): | ||
self.assertEqual(parse_newfragment_basename('baz.1.2.feature.3', | ||
['feature']), | ||
('2', 'feature', 3)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters