Skip to content

Commit

Permalink
#47 fix optional field
Browse files Browse the repository at this point in the history
  • Loading branch information
Tishka17 committed Dec 20, 2019
1 parent 575b526 commit fcec027
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/test_optional.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from typing import Dict, Optional
from unittest import TestCase

from dataclasses import dataclass

from dataclass_factory import Factory


@dataclass
class Data:
x: Optional[Dict[str, None]]


class TestOptional(TestCase):
def test_optional(self):
factory = Factory()
y = factory.load({"x": None}, Data)
self.assertEqual(y, Data(None))
Empty file added tests/test_synonym.py
Empty file.

0 comments on commit fcec027

Please sign in to comment.