Commit 360808dc authored by Gabriel Couture's avatar Gabriel Couture

Edit function's name

parent cc4a37e4
Pipeline #288 passed with stage
in 11 seconds
......@@ -10,7 +10,7 @@ structure name filter in your program.
import tg263
# Result is `True`
result = tg263.is_structure_name_is_allowed('Prostate')
result = tg263.is_structure_name_allowed('Prostate')
```
......
......@@ -2,7 +2,7 @@
# author: Gabriel Couture
import unittest
from tg263.allowed_structure_names import is_structure_name_is_allowed
from tg263.allowed_structure_names import is_structure_name_allowed
class TestAllowedStructureNames(unittest.TestCase):
......@@ -11,12 +11,12 @@ class TestAllowedStructureNames(unittest.TestCase):
self.an_allowed_structure_name = 'Prostate'
self.a_not_allowed_structure_name = 'A_NOT_ALLOWED_STRUCTURE_NAME'
def test_givenAnAllowedStructureName_whenAskingIfStructureNameIsAllowed_thenResultIsTrue(self) -> None:
result = is_structure_name_is_allowed(self.an_allowed_structure_name)
def test_givenAnAllowedStructureName_whenAskingIfStructureNameAllowed_thenResultIsTrue(self) -> None:
result = is_structure_name_allowed(self.an_allowed_structure_name)
self.assertTrue(result)
def test_givenANotAllowedStructureName_whenAskingIfStructureNameIsAllowed_thenResultIsFalse(self) -> None:
result = is_structure_name_is_allowed(self.a_not_allowed_structure_name)
def test_givenANotAllowedStructureName_whenAskingIfStructureNameAllowed_thenResultIsFalse(self) -> None:
result = is_structure_name_allowed(self.a_not_allowed_structure_name)
self.assertFalse(result)
# coding: utf-8
# author: Gabriel Couture
from tg263.allowed_structure_names import is_structure_name_is_allowed
from tg263.allowed_structure_names import is_structure_name_allowed
from tg263.dictionary import ALLOWED_STRUCTURE_NAMES
__all__ = [
'is_structure_name_is_allowed',
'is_structure_name_allowed',
'ALLOWED_STRUCTURE_NAMES'
]
......@@ -5,7 +5,7 @@ import functools
from tg263.dictionary import ALLOWED_STRUCTURE_NAMES
def is_structure_name_is_allowed(structure_name: str) -> bool:
def is_structure_name_allowed(structure_name: str) -> bool:
return functools.reduce(
lambda j, i: j or False if i.regex.match(structure_name) is None else True,
ALLOWED_STRUCTURE_NAMES,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment