encommon 0.7.6__py3-none-any.whl → 0.8.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. encommon/config/__init__.py +4 -0
  2. encommon/config/common.py +18 -14
  3. encommon/config/config.py +8 -5
  4. encommon/config/files.py +13 -7
  5. encommon/config/logger.py +94 -88
  6. encommon/config/params.py +1 -1
  7. encommon/config/paths.py +16 -8
  8. encommon/config/test/test_common.py +27 -4
  9. encommon/config/test/test_config.py +48 -82
  10. encommon/config/test/test_files.py +58 -43
  11. encommon/config/test/test_logger.py +129 -82
  12. encommon/config/test/test_paths.py +70 -30
  13. encommon/conftest.py +52 -12
  14. encommon/crypts/__init__.py +2 -0
  15. encommon/crypts/crypts.py +3 -1
  16. encommon/crypts/hashes.py +2 -2
  17. encommon/crypts/test/test_crypts.py +50 -28
  18. encommon/crypts/test/test_hashes.py +20 -18
  19. encommon/times/__init__.py +2 -0
  20. encommon/times/common.py +99 -15
  21. encommon/times/duration.py +50 -36
  22. encommon/times/parse.py +13 -25
  23. encommon/times/test/test_common.py +47 -16
  24. encommon/times/test/test_duration.py +104 -79
  25. encommon/times/test/test_parse.py +53 -63
  26. encommon/times/test/test_timers.py +90 -36
  27. encommon/times/test/test_times.py +21 -30
  28. encommon/times/test/test_window.py +73 -21
  29. encommon/times/timers.py +91 -58
  30. encommon/times/times.py +36 -34
  31. encommon/times/window.py +4 -4
  32. encommon/types/dicts.py +10 -4
  33. encommon/types/empty.py +7 -2
  34. encommon/types/strings.py +10 -0
  35. encommon/types/test/test_dicts.py +5 -5
  36. encommon/types/test/test_empty.py +4 -1
  37. encommon/types/test/test_strings.py +1 -1
  38. encommon/utils/__init__.py +4 -0
  39. encommon/utils/common.py +51 -6
  40. encommon/utils/match.py +1 -0
  41. encommon/utils/paths.py +42 -23
  42. encommon/utils/sample.py +31 -27
  43. encommon/utils/stdout.py +28 -17
  44. encommon/utils/test/test_common.py +35 -0
  45. encommon/utils/test/test_paths.py +3 -2
  46. encommon/utils/test/test_sample.py +28 -12
  47. encommon/version.txt +1 -1
  48. {encommon-0.7.6.dist-info → encommon-0.8.0.dist-info}/METADATA +1 -1
  49. encommon-0.8.0.dist-info/RECORD +63 -0
  50. encommon-0.7.6.dist-info/RECORD +0 -62
  51. {encommon-0.7.6.dist-info → encommon-0.8.0.dist-info}/LICENSE +0 -0
  52. {encommon-0.7.6.dist-info → encommon-0.8.0.dist-info}/WHEEL +0 -0
  53. {encommon-0.7.6.dist-info → encommon-0.8.0.dist-info}/top_level.txt +0 -0
@@ -14,6 +14,8 @@ from .config import Config
14
14
  from .files import ConfigFile
15
15
  from .files import ConfigFiles
16
16
  from .logger import Logger
17
+ from .params import ConfigParams
18
+ from .params import LoggerParams
17
19
  from .params import Params
18
20
  from .paths import ConfigPath
19
21
  from .paths import ConfigPaths
@@ -24,9 +26,11 @@ __all__ = [
24
26
  'Config',
25
27
  'ConfigFile',
26
28
  'ConfigFiles',
29
+ 'ConfigParams',
27
30
  'ConfigPath',
28
31
  'ConfigPaths',
29
32
  'Logger',
33
+ 'LoggerParams',
30
34
  'Params',
31
35
  'config_load',
32
36
  'config_path',
encommon/config/common.py CHANGED
@@ -11,15 +11,20 @@ from pathlib import Path
11
11
  from typing import Any
12
12
  from typing import Literal
13
13
  from typing import Optional
14
+ from typing import TYPE_CHECKING
14
15
 
15
16
  from yaml import SafeLoader
16
17
  from yaml import load
17
18
 
18
19
  from .. import PROJECT
19
20
  from .. import WORKSPACE
20
- from ..utils.common import PATHABLE
21
- from ..utils.paths import resolve_path
22
- from ..utils.paths import resolve_paths
21
+ from ..utils import read_text
22
+ from ..utils import resolve_path
23
+ from ..utils import resolve_paths
24
+
25
+ if TYPE_CHECKING:
26
+ from ..utils.common import PATHABLE
27
+ from ..utils.common import REPLACE
23
28
 
24
29
 
25
30
 
@@ -42,9 +47,8 @@ def config_load(
42
47
  :returns: New resolved filesystem path object instance.
43
48
  """
44
49
 
45
- loaded = (
46
- config_path(path)
47
- .read_text(encoding='utf-8'))
50
+ loaded = read_text(
51
+ config_path(path))
48
52
 
49
53
  parsed = load(loaded, SafeLoader)
50
54
 
@@ -58,7 +62,7 @@ def config_path(
58
62
  path: str | Path,
59
63
  ) -> Path:
60
64
  """
61
- Resolve the provided path and replace the magic keywords.
65
+ Resolve the provided path replacing the magic keywords.
62
66
 
63
67
  .. note::
64
68
  This function simply wraps one from utils subpackage.
@@ -68,19 +72,19 @@ def config_path(
68
72
  """
69
73
 
70
74
  replace = {
71
- 'PROJECT': str(PROJECT),
72
- 'WORKSPACE': str(WORKSPACE)}
75
+ 'PROJECT': PROJECT,
76
+ 'WORKSPACE': WORKSPACE}
73
77
 
74
78
  return resolve_path(path, replace)
75
79
 
76
80
 
77
81
 
78
82
  def config_paths(
79
- paths: PATHABLE,
80
- replace: Optional[dict[str, str]] = None,
83
+ paths: 'PATHABLE',
84
+ replace: Optional['REPLACE'] = None,
81
85
  ) -> tuple[Path, ...]:
82
86
  """
83
- Resolve the provided paths and replace the magic keywords.
87
+ Resolve the provided paths replacing the magic keywords.
84
88
 
85
89
  .. note::
86
90
  This function simply wraps one from utils subpackage.
@@ -90,7 +94,7 @@ def config_paths(
90
94
  """
91
95
 
92
96
  replace = {
93
- 'PROJECT': str(PROJECT),
94
- 'WORKSPACE': str(WORKSPACE)}
97
+ 'PROJECT': PROJECT,
98
+ 'WORKSPACE': WORKSPACE}
95
99
 
96
100
  return resolve_paths(paths, replace)
encommon/config/config.py CHANGED
@@ -11,15 +11,18 @@ from copy import deepcopy
11
11
  from typing import Any
12
12
  from typing import Callable
13
13
  from typing import Optional
14
+ from typing import TYPE_CHECKING
14
15
 
15
16
  from .common import config_paths
16
17
  from .files import ConfigFiles
17
18
  from .logger import Logger
18
19
  from .params import Params
19
20
  from .paths import ConfigPaths
20
- from ..crypts.crypts import Crypts
21
- from ..types.dicts import merge_dicts
22
- from ..utils.common import PATHABLE
21
+ from ..crypts import Crypts
22
+ from ..types import merge_dicts
23
+
24
+ if TYPE_CHECKING:
25
+ from ..utils.common import PATHABLE
23
26
 
24
27
 
25
28
 
@@ -52,8 +55,8 @@ class Config:
52
55
  def __init__(
53
56
  self,
54
57
  *,
55
- files: Optional[PATHABLE] = None,
56
- paths: Optional[PATHABLE] = None,
58
+ files: Optional['PATHABLE'] = None,
59
+ paths: Optional['PATHABLE'] = None,
57
60
  cargs: Optional[dict[str, Any]] = None,
58
61
  model: Optional[Callable] = None, # type: ignore
59
62
  ) -> None:
encommon/config/files.py CHANGED
@@ -11,12 +11,15 @@ from copy import deepcopy
11
11
  from pathlib import Path
12
12
  from typing import Any
13
13
  from typing import Optional
14
+ from typing import TYPE_CHECKING
14
15
 
15
16
  from .common import config_load
16
17
  from .common import config_path
17
18
  from .common import config_paths
18
19
  from ..types import merge_dicts
19
- from ..utils.common import PATHABLE
20
+
21
+ if TYPE_CHECKING:
22
+ from ..utils.common import PATHABLE
20
23
 
21
24
 
22
25
 
@@ -63,7 +66,7 @@ class ConfigFiles:
63
66
 
64
67
  def __init__(
65
68
  self,
66
- paths: PATHABLE,
69
+ paths: 'PATHABLE',
67
70
  force: bool = False,
68
71
  ) -> None:
69
72
  """
@@ -89,13 +92,16 @@ class ConfigFiles:
89
92
  :returns: Configuration in dictionary format for files.
90
93
  """
91
94
 
92
- if self.__merged is not None:
93
- return deepcopy(self.__merged)
95
+ config = self.config
96
+ merged = self.__merged
97
+
98
+ if merged is not None:
99
+ return deepcopy(merged)
94
100
 
95
- merged: dict[str, Any] = {}
101
+ merged = {}
96
102
 
97
103
 
98
- for _, file in self.config.items():
104
+ for file in config.values():
99
105
 
100
106
  source = file.config
101
107
 
@@ -107,4 +113,4 @@ class ConfigFiles:
107
113
 
108
114
  self.__merged = merged
109
115
 
110
- return deepcopy(self.__merged)
116
+ return deepcopy(merged)
encommon/config/logger.py CHANGED
@@ -28,18 +28,22 @@ from typing import TYPE_CHECKING
28
28
 
29
29
  from .common import LOGLEVELS
30
30
  from .common import config_path
31
- from ..times.common import PARSABLE
32
- from ..times.times import Times
33
- from ..types.empty import Empty
34
- from ..utils.stdout import kvpair_ansi
31
+ from ..times import Times
32
+ from ..types import Empty
33
+ from ..types.strings import COMMAD
34
+ from ..types.strings import COMMAS
35
+ from ..types.strings import SPACED
36
+ from ..utils import kvpair_ansi
37
+ from ..utils.common import JOINABLE
35
38
 
36
39
  if TYPE_CHECKING:
37
40
  from .params import LoggerParams
41
+ from ..times.common import PARSABLE
38
42
 
39
43
 
40
44
 
41
- LOGGER_FILE = 'encommon.logger.file'
42
- LOGGER_STDO = 'encommon.logger.stdo'
45
+ LOGR_FILE = 'encommon.logger.file'
46
+ LOGR_STDO = 'encommon.logger.stdo'
43
47
 
44
48
  LOGSEVERS = {
45
49
  'critical': int(CRITICAL),
@@ -79,7 +83,7 @@ class Message:
79
83
  def __init__(
80
84
  self,
81
85
  level: LOGLEVELS,
82
- time: Optional[PARSABLE] = None,
86
+ time: Optional['PARSABLE'] = None,
83
87
  **kwargs: Any,
84
88
  ) -> None:
85
89
  """
@@ -90,7 +94,10 @@ class Message:
90
94
  self.__time = Times(time)
91
95
  self.__fields = {}
92
96
 
93
- for key, value in kwargs.items():
97
+ items = kwargs.items()
98
+
99
+ for key, value in items:
100
+
94
101
 
95
102
  if (hasattr(value, '__len__')
96
103
  and not len(value)):
@@ -99,10 +106,21 @@ class Message:
99
106
  if value in [None, Empty]:
100
107
  continue
101
108
 
102
- if (key == 'elapsed'
103
- and isinstance(value, float)):
109
+
110
+ if isinstance(value, JOINABLE):
111
+
112
+ values = sorted(
113
+ str(x) for x in value)
114
+
115
+ value = COMMAD.join(values)
116
+
117
+
118
+ if (isinstance(value, float)
119
+ and key == 'elapsed'):
120
+
104
121
  value = round(value, 2)
105
122
 
123
+
106
124
  value = str(value)
107
125
 
108
126
  self.__fields[key] = value
@@ -123,7 +141,7 @@ class Message:
123
141
 
124
142
  fields |= dict(self.__fields)
125
143
 
126
- message = ', '.join([
144
+ message = COMMAS.join([
127
145
  f'{k}="{v}"' for k, v
128
146
  in fields.items()])
129
147
 
@@ -205,11 +223,16 @@ class Message:
205
223
 
206
224
  output: list[str] = []
207
225
 
208
- for key, value in fields.items():
209
- output.append(
210
- kvpair_ansi(key, value))
226
+ items = fields.items()
227
+
228
+ for field, value in items:
229
+
230
+ _value = kvpair_ansi(
231
+ field, value)
232
+
233
+ output.append(_value)
211
234
 
212
- return ' '.join(output)
235
+ return SPACED.join(output)
213
236
 
214
237
 
215
238
  @property
@@ -235,7 +258,7 @@ class Message:
235
258
 
236
259
  class FileFormatter(Formatter):
237
260
  """
238
- Supplement class for built-in logging exception formatter.
261
+ Supplement class for built-in logger exception formatter.
239
262
  """
240
263
 
241
264
 
@@ -299,8 +322,8 @@ class Logger:
299
322
 
300
323
  __started: bool
301
324
 
302
- __logger_stdo: _Logger
303
- __logger_file: _Logger
325
+ __logr_stdo: _Logger
326
+ __logr_file: _Logger
304
327
 
305
328
 
306
329
  def __init__(
@@ -329,8 +352,11 @@ class Logger:
329
352
 
330
353
  self.__started = False
331
354
 
332
- self.__logger_stdo = getLogger(LOGGER_STDO)
333
- self.__logger_file = getLogger(LOGGER_FILE)
355
+ logr_stdo = getLogger(LOGR_STDO)
356
+ logr_file = getLogger(LOGR_FILE)
357
+
358
+ self.__logr_stdo = logr_stdo
359
+ self.__logr_file = logr_file
334
360
 
335
361
 
336
362
  @property
@@ -395,7 +421,7 @@ class Logger:
395
421
  :returns: Value for the attribute from class instance.
396
422
  """
397
423
 
398
- return self.__logger_stdo
424
+ return self.__logr_stdo
399
425
 
400
426
 
401
427
  @property
@@ -408,7 +434,7 @@ class Logger:
408
434
  :returns: Value for the attribute from class instance.
409
435
  """
410
436
 
411
- return self.__logger_file
437
+ return self.__logr_file
412
438
 
413
439
 
414
440
  def start(
@@ -422,39 +448,47 @@ class Logger:
422
448
  file_level = self.__file_level
423
449
  file_path = self.__file_path
424
450
 
425
- logger_stdo = self.__logger_stdo
426
- logger_file = self.__logger_file
451
+ logr_stdo = self.__logr_stdo
452
+ logr_file = self.__logr_file
453
+
427
454
 
455
+ logr_root = getLogger()
428
456
 
429
- logger_root = getLogger()
430
- logger_root.setLevel(NOTSET)
457
+ logr_root.setLevel(NOTSET)
431
458
 
432
- logger_stdo.handlers = [NullHandler()]
433
- logger_file.handlers = [NullHandler()]
459
+ logr_stdo.handlers = [NullHandler()]
460
+ logr_file.handlers = [NullHandler()]
434
461
 
435
462
 
436
463
  if stdo_level is not None:
437
464
 
438
- stdoh = StreamHandler()
439
- format = Formatter('%(message)s')
440
465
  level = LOGSEVERS[stdo_level]
441
466
 
442
- stdoh.setLevel(level)
443
- stdoh.setFormatter(format)
467
+ handstdo = StreamHandler()
468
+
469
+ format = Formatter(
470
+ '%(message)s')
471
+
472
+ logr_stdo.handlers = [handstdo]
444
473
 
445
- logger_stdo.handlers = [stdoh]
474
+ handstdo.setLevel(level)
475
+ handstdo.setFormatter(format)
446
476
 
447
477
 
448
478
  if file_path and file_level:
449
479
 
450
- fileh = FileHandler(file_path)
451
- format = FileFormatter('%(message)s')
452
480
  level = LOGSEVERS[file_level]
453
481
 
454
- fileh.setLevel(level)
455
- fileh.setFormatter(format)
482
+ handfile = (
483
+ FileHandler(file_path))
456
484
 
457
- logger_file.handlers = [fileh]
485
+ format = FileFormatter(
486
+ '%(message)s')
487
+
488
+ logr_file.handlers = [handfile]
489
+
490
+ handfile.setLevel(level)
491
+ handfile.setFormatter(format)
458
492
 
459
493
 
460
494
  self.__started = True
@@ -467,11 +501,11 @@ class Logger:
467
501
  Deinitialize the Python logging library using parameters.
468
502
  """
469
503
 
470
- logger_stdo = self.__logger_stdo
471
- logger_file = self.__logger_file
504
+ logr_stdo = self.__logr_stdo
505
+ logr_file = self.__logr_file
472
506
 
473
- logger_stdo.handlers = [NullHandler()]
474
- logger_file.handlers = [NullHandler()]
507
+ logr_stdo.handlers = [NullHandler()]
508
+ logr_file.handlers = [NullHandler()]
475
509
 
476
510
  self.__started = False
477
511
 
@@ -484,9 +518,9 @@ class Logger:
484
518
  **kwargs: Any,
485
519
  ) -> None:
486
520
  """
487
- Prepare keyword arguments and log to the relevant outputs.
521
+ Prepare keyword arguments and log to configured output.
488
522
 
489
- :param exc_info: Optional exception to include with trace.
523
+ :param exc_info: Optional exception included with trace.
490
524
  :param kwargs: Keyword arguments for populating message.
491
525
  """
492
526
 
@@ -497,19 +531,21 @@ class Logger:
497
531
  file_level = self.__file_level
498
532
  file_path = self.__file_path
499
533
 
500
- logger_stdo = self.__logger_stdo
501
- logger_file = self.__logger_file
534
+ logr_stdo = self.__logr_stdo
535
+ logr_file = self.__logr_file
502
536
 
503
537
  message = Message(level, **kwargs)
504
538
 
505
539
  if stdo_level is not None:
506
- logger_stdo.log(
540
+
541
+ logr_stdo.log(
507
542
  level=LOGSEVERS[level],
508
543
  msg=message.stdo_output,
509
544
  exc_info=exc_info)
510
545
 
511
546
  if file_path and file_level:
512
- logger_file.log(
547
+
548
+ logr_file.log(
513
549
  level=LOGSEVERS[level],
514
550
  msg=message.file_output,
515
551
  exc_info=exc_info)
@@ -517,94 +553,64 @@ class Logger:
517
553
 
518
554
  def log_c(
519
555
  self,
520
- *,
521
- exc_info: Optional[Exception] = None,
522
556
  **kwargs: Any,
523
557
  ) -> None:
524
558
  """
525
- Prepare keyword arguments and log to the relevant outputs.
559
+ Prepare keyword arguments and log to configured output.
526
560
 
527
- :param exc_info: Optional exception to include with trace.
528
561
  :param kwargs: Keyword arguments for populating message.
529
562
  """
530
563
 
531
- self.log(
532
- level='critical',
533
- exc_info=exc_info,
534
- **kwargs)
564
+ self.log('critical', **kwargs)
535
565
 
536
566
 
537
567
  def log_d(
538
568
  self,
539
- *,
540
- exc_info: Optional[Exception] = None,
541
569
  **kwargs: Any,
542
570
  ) -> None:
543
571
  """
544
- Prepare keyword arguments and log to the relevant outputs.
572
+ Prepare keyword arguments and log to configured output.
545
573
 
546
- :param exc_info: Optional exception to include with trace.
547
574
  :param kwargs: Keyword arguments for populating message.
548
575
  """
549
576
 
550
- self.log(
551
- level='debug',
552
- exc_info=exc_info,
553
- **kwargs)
577
+ self.log('debug', **kwargs)
554
578
 
555
579
 
556
580
  def log_e(
557
581
  self,
558
- *,
559
- exc_info: Optional[Exception] = None,
560
582
  **kwargs: Any,
561
583
  ) -> None:
562
584
  """
563
- Prepare keyword arguments and log to the relevant outputs.
585
+ Prepare keyword arguments and log to configured output.
564
586
 
565
- :param exc_info: Optional exception to include with trace.
566
587
  :param kwargs: Keyword arguments for populating message.
567
588
  """
568
589
 
569
- self.log(
570
- level='error',
571
- exc_info=exc_info,
572
- **kwargs)
590
+ self.log('error', **kwargs)
573
591
 
574
592
 
575
593
  def log_i(
576
594
  self,
577
- *,
578
- exc_info: Optional[Exception] = None,
579
595
  **kwargs: Any,
580
596
  ) -> None:
581
597
  """
582
- Prepare keyword arguments and log to the relevant outputs.
598
+ Prepare keyword arguments and log to configured output.
583
599
 
584
- :param exc_info: Optional exception to include with trace.
585
600
  :param kwargs: Keyword arguments for populating message.
586
601
  """
587
602
 
588
- self.log(
589
- level='info',
590
- exc_info=exc_info,
591
- **kwargs)
603
+ self.log('info', **kwargs)
592
604
 
593
605
 
594
606
  def log_w(
595
607
  self,
596
- *,
597
- exc_info: Optional[Exception] = None,
598
608
  **kwargs: Any,
599
609
  ) -> None:
600
610
  """
601
- Prepare keyword arguments and log to the relevant outputs.
611
+ Prepare keyword arguments and log to configured output.
602
612
 
603
- :param exc_info: Optional exception to include with trace.
604
613
  :param kwargs: Keyword arguments for populating message.
605
614
  """
606
615
 
607
- self.log(
608
- level='warning',
609
- exc_info=exc_info,
610
- **kwargs)
616
+ self.log('warning', **kwargs)
encommon/config/params.py CHANGED
@@ -12,7 +12,7 @@ from typing import Optional
12
12
  from pydantic import BaseModel
13
13
 
14
14
  from .common import LOGLEVELS
15
- from ..crypts.params import CryptsParams
15
+ from ..crypts import CryptsParams
16
16
 
17
17
 
18
18
 
encommon/config/paths.py CHANGED
@@ -12,11 +12,14 @@ from glob import glob
12
12
  from pathlib import Path
13
13
  from typing import Any
14
14
  from typing import Optional
15
+ from typing import TYPE_CHECKING
15
16
 
16
17
  from .common import config_path
17
18
  from .common import config_paths
18
19
  from .files import ConfigFile
19
- from ..utils.common import PATHABLE
20
+
21
+ if TYPE_CHECKING:
22
+ from ..utils.common import PATHABLE
20
23
 
21
24
 
22
25
 
@@ -71,7 +74,7 @@ class ConfigPaths:
71
74
 
72
75
  def __init__(
73
76
  self,
74
- paths: PATHABLE,
77
+ paths: 'PATHABLE',
75
78
  force: bool = False,
76
79
  ) -> None:
77
80
  """
@@ -97,19 +100,24 @@ class ConfigPaths:
97
100
  :returns: Configuration in dictionary format for paths.
98
101
  """
99
102
 
100
- if self.__merged is not None:
101
- return deepcopy(self.__merged)
103
+ config = self.config
104
+ merged = self.__merged
105
+
106
+ if merged is not None:
107
+ return deepcopy(merged)
108
+
109
+ merged = {}
102
110
 
103
- merged: dict[str, Any] = {}
104
111
 
112
+ for path in config.values():
105
113
 
106
- for _, path in self.config.items():
114
+ items = path.config.items()
107
115
 
108
- for key, file in path.config.items():
116
+ for key, file in items:
109
117
 
110
118
  merged[key] = file.config
111
119
 
112
120
 
113
121
  self.__merged = merged
114
122
 
115
- return deepcopy(self.__merged)
123
+ return deepcopy(merged)
@@ -9,6 +9,7 @@ is permitted, for more information consult the project license file.
9
9
 
10
10
  from ..common import config_load
11
11
  from ..common import config_path
12
+ from ..common import config_paths
12
13
  from ... import PROJECT
13
14
  from ... import WORKSPACE
14
15
 
@@ -19,9 +20,11 @@ def test_config_load() -> None:
19
20
  Perform various tests associated with relevant routines.
20
21
  """
21
22
 
22
- path = 'PROJECT/../.yamllint'
23
+ loaded = config_load(
24
+ 'PROJECT/../.yamllint')
23
25
 
24
- assert len(config_load(path)) == 2
26
+ assert list(loaded) == [
27
+ 'extends', 'rules']
25
28
 
26
29
 
27
30
 
@@ -30,5 +33,25 @@ def test_config_path() -> None:
30
33
  Perform various tests associated with relevant routines.
31
34
  """
32
35
 
33
- assert config_path('PROJECT') == PROJECT
34
- assert config_path('WORKSPACE') == WORKSPACE
36
+
37
+ path = config_path('PROJECT')
38
+
39
+ assert path == PROJECT
40
+
41
+
42
+ path = config_path('WORKSPACE')
43
+
44
+ assert path == WORKSPACE
45
+
46
+
47
+
48
+ def test_config_paths() -> None:
49
+ """
50
+ Perform various tests associated with relevant routines.
51
+ """
52
+
53
+ paths = config_paths([
54
+ 'PROJECT', 'WORKSPACE'])
55
+
56
+ assert paths == (
57
+ PROJECT, WORKSPACE)