feat(namespace): Add Namespace entity a description field

Description

Abstract

Adds a description field to the Namespace entity of the core domain context.

Motivation

To display users more information about the namespace.

Rationale

Simply an optional str field.

Info

Hash

1568d2faf1dddc36e2b277359d355fe08cae85c5

Date

2019-06-07 21:03:51 +0200

Parents
  • feat(namespace): Add Namespace entity a `kind` field [a6b70f9e]2019-06-07 21:03:51 +0200

Children
  • Merge branch ‘feature/twidi/base-entities’ into develop [0687e29b]2019-06-07 21:06:25 +0200

Branches
Tags

(No tags)

Changes

isshub/domain/contexts/core/entities/namespace/__init__.py

Type

Modified

Stats

+5 -0

@@ -38,12 +38,15 @@ class _Namespace(BaseModelWithId):
         Where the namespace can be found.
     kind : NamespaceKind
         The kind of namespace.
+    description : Optional[str]
+        The description of the namespace.

     """

     name: str = required_field(str)  # type: ignore
     namespace = None
     kind: NamespaceKind = required_field(NamespaceKind)  # type: ignore
+    description: str = optional_field(str)  # type: ignore


 @validated()  # type: ignore
@@ -60,6 +63,8 @@ class Namespace(_Namespace):
         Where the namespace can be found.
     kind : NamespaceKind
         The kind of namespace.
+    description : Optional[str]
+        The description of the namespace.

     """

isshub/domain/contexts/core/entities/namespace/features/describe.feature

Type

Modified

Stats

+12 -0

@@ -24,6 +24,18 @@ Feature: Describing a Namespace
         Given a Namespace
         Then its name cannot be None

+    Scenario: A Namespace has a description
+        Given a Namespace
+        Then it must have a field named description
+
+    Scenario: A Namespace description is a string
+        Given a Namespace
+        Then its description must be a string
+
+    Scenario: A Namespace description can be None
+        Given a Namespace
+        Then its description can be None
+
     Scenario: A Namespace has a namespace
         Given a Namespace
         Then it must have a field named namespace

isshub/domain/contexts/core/entities/namespace/tests/test_describe.py

Type

Modified

Stats

+6 -0

@@ -47,6 +47,12 @@ def test_namespace_kind_is_a_namespacekind(value, exception):
     pass


+@mark.parametrize(["value", "exception"], string_only)
+@scenario("../features/describe.feature", "A Namespace description is a string")
+def test_namespace_description_is_a_string(value, exception):
+    pass
+
+
 scenarios("../features/describe.feature")