def test_invalid_2(): doc = """ date """ val = "2017/03/99" t = make_type(doc) assert not t.valid(val)
def test_invalid_2c(): doc = """ time """ val = "12:34:96" t = make_type(doc) assert not t.valid(val)
def test_make_valid(): doc = """ d_u: foo: string bar: number """ t = make_type(doc)
def test_valid_1(): doc = """ time """ val = "12:34:56.789" t = make_type(doc) assert t.valid(val)
def test_invalid_2a(): doc = """ time """ val = "32:34:56" t = make_type(doc) assert not t.valid(val)
def test_valid_1b(): doc = """ regex: '[A-F][1-5]' """ val = 'F5extra' t = make_type(doc) assert t.valid(val)
def test_invalid(): doc = """ string """ val = 1 t = make_type(doc) assert not t.valid(val)
def test_invalid_0(): doc = """ tuple: [string, number, string] """ val = 42 t = make_type(doc) assert not t.valid(val)
def test_invalid_1(): doc = """ tuple: [string, number, string] """ val = ('foo', 'bar', 'baz') t = make_type(doc) assert not t.valid(val)
def test_valid_2a(): doc = """ tuple: [string, number, list: string] """ val = ['foo', 42, ['bar', 'baz']] t = make_type(doc) assert t.valid(val)
def test_valid_2b(): doc = """ tuple: [string, number, list: string] """ val = ('foo', 42, ('bar', 'baz')) t = make_type(doc) assert t.valid(val)
def test_valid_1b(): doc = """ tuple: [string, number, string] """ val = ('foo', 42, 'bar') t = make_type(doc) assert t.valid(val)
def test_valid(): doc = """ date """ val = "2017/03/25" t = make_type(doc) assert t.valid(val)
def test_invalid_3(): doc = """ date """ val = "2017/03/25extra" t = make_type(doc) assert not t.valid(val)
def test_invalid_1(): doc = """ oneof: [foo, bar, baz] """ val = 'qux' t = make_type(doc) assert not t.valid(val)
def test_valid_1(): doc = """ number """ val = 20 t = make_type(doc) assert t.valid(val)
def test_valid_1a(): doc = """ regex: '[A-F][1-5]' """ val = 'A1' t = make_type(doc) assert t.valid(val)
def test_valid_2(): doc = """ number """ val = 3.14 t = make_type(doc) assert t.valid(val)
def test_invalid_1(): doc = """ regex: '[A-F][1-5]' """ val = 'qux' t = make_type(doc) assert not t.valid(val)
def test_valid_3a(): doc = """ number """ val = "-12345" t = make_type(doc) assert t.valid(val)
def test_valid(): doc = """ string """ val = "foo" t = make_type(doc) assert t.valid(val)
def test_valid_3c(): doc = """ number """ val = "3.14e-2" t = make_type(doc) assert t.valid(val)
def test_invalid_1(): doc = """ time """ val = "12" t = make_type(doc) assert not t.valid(val)
def test_invalid_0(): doc = """ number """ val = "abc" t = make_type(doc) assert not t.valid(val)
def test_invalid_2b(): doc = """ time """ val = "12:74:56" t = make_type(doc) assert not t.valid(val)
def test_invalid_1(): doc = """ number """ val = ['foo', 'bar'] t = make_type(doc) assert not t.valid(val)
def test_invalid_3(): doc = """ time """ val = "12:34:56extra" t = make_type(doc) assert not t.valid(val)
def test_valid_1b(): doc = """ oneof: [foo, bar, baz] """ val = 'baz' t = make_type(doc) assert t.valid(val)
def test_make_valid(): doc = """ union: - string - number """ t = make_type(doc)
def test_invalid_0(): doc = """ date """ val = 1 t = make_type(doc) assert not t.valid(val)