factories.py (removed)¶
Last source¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | """Module defining factories for the Namespace code_repository entity."""
import factory
from faker_enum import EnumProvider
from isshub.domain.contexts.code_repository.entities.namespace import (
Namespace,
NamespaceKind,
)
factory.Faker.add_provider(EnumProvider)
class NamespaceFactory(factory.Factory):
"""Factory for the ``Namespace`` code_repository entity."""
class Meta:
"""Factory config."""
model = Namespace
id = factory.Faker("pyint", min_value=1)
name = factory.Faker("pystr", min_chars=2)
kind = factory.Faker("enum", enum_cls=NamespaceKind)
|
Changes¶
refactor(core): Rename core domain context to code_repository¶
- Commit
- Hash
- Date
2019-08-15 23:31:33 +0200
- Type
Renamed
- New path
isshub/domain/contexts/code_repository/entities/namespace/tests/factories.py
- Stats
+6 -3
@@ -1,17 +1,20 @@
-"""Module defining factories for the Namespace core entity."""
+"""Module defining factories for the Namespace code_repository entity."""
import factory
from faker_enum import EnumProvider
-from isshub.domain.contexts.core.entities.namespace import Namespace, NamespaceKind
+from isshub.domain.contexts.code_repository.entities.namespace import (
+ Namespace,
+ NamespaceKind,
+)
factory.Faker.add_provider(EnumProvider)
class NamespaceFactory(factory.Factory):
- """Factory for the ``Namespace`` core entity."""
+ """Factory for the ``Namespace`` code_repository entity."""
class Meta:
"""Factory config."""
fix(faker): Handle change of min (to min_value) arg for pyint¶
- Commit
- Hash
- Date
2019-08-15 23:15:21 +0200
- Type
Modified
- Stats
+1 -1
@@ -18,6 +18,6 @@ class NamespaceFactory(factory.Factory):
model = Namespace
- id = factory.Faker("pyint", min=1)
+ id = factory.Faker("pyint", min_value=1)
name = factory.Faker("pystr", min_chars=2)
kind = factory.Faker("enum", enum_cls=NamespaceKind)
feat(namespace): Add Namespace entity a kind field¶
- Commit
- Hash
- Date
2019-06-07 21:03:51 +0200
- Type
Modified
- Stats
+7 -1
@@ -2,7 +2,12 @@
import factory
-from isshub.domain.contexts.core.entities.namespace import Namespace
+from faker_enum import EnumProvider
+
+from isshub.domain.contexts.core.entities.namespace import Namespace, NamespaceKind
+
+
+factory.Faker.add_provider(EnumProvider)
class NamespaceFactory(factory.Factory):
@@ -15,3 +20,4 @@ class NamespaceFactory(factory.Factory):
id = factory.Faker("pyint", min=1)
name = factory.Faker("pystr", min_chars=2)
+ kind = factory.Faker("enum", enum_cls=NamespaceKind)
feat(namespace): Add Namespace entity in core domain context¶
- Commit
- Hash
- Date
2019-06-07 21:03:50 +0200
- Type
Added
- Stats
+17 -0
@@ -0,0 +1,17 @@
+"""Module defining factories for the Namespace core entity."""
+
+import factory
+
+from isshub.domain.contexts.core.entities.namespace import Namespace
+
+
+class NamespaceFactory(factory.Factory):
+ """Factory for the ``Namespace`` core entity."""
+
+ class Meta:
+ """Factory config."""
+
+ model = Namespace
+
+ id = factory.Faker("pyint", min=1)
+ name = factory.Faker("pystr", min_chars=2)