Skip to content
Snippets Groups Projects
Commit ff85ae14 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

v2.15.1

parent af81afef
No related branches found
Tags v2.15.1
No related merge requests found
__version__ = '2.15.1a1'
__version__ = '2.15.1'
......@@ -9,7 +9,7 @@ from .structs import create_key, Dict
def _get_descriptor_for_str(key: str, value: str) -> Descriptor:
try:
if value in ('int', 'float', 'str', 'ipv4', 'any', 'bool'):
if value in ('int', 'float', 'str', 'ipv4', 'any', 'bool', 'file'):
return create_key(BASE_LOOKUP_TABLE[value](),
key, False, None)
except KeyError:
......
......@@ -14,6 +14,17 @@ class Environment(enum.IntEnum):
class TestSchema(unittest.TestCase):
def test_file(self):
schema = {
"key": "file"
}
with open('test', 'wb') as f_out:
f_out.write(b'test')
s = descriptor_from_dict(schema)
self.assertEqual(s({'key': "test"}), {'key': 'test'})
def test_caster(self):
ps = Caster(Environment)
self.assertEqual(ps(0), Environment.PRODUCTION)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment