def dic(obj): check_type(Dict(key=str, val=int), obj)
def dict2(obj): check_type(Dict( (int, int), float ), obj)
def dict1(obj): check_type(Dict( int, {int: float}), obj)
def test_hash(self): from typecheck import Dict class A(object): pass class B(A): pass eq_tests = [ (Dict(str, int), Dict(str, int)), (Dict(str, A), Dict(str, A)), (Dict(str, Dict(str, int)), Dict(str, Dict(str, int))) ] ne_tests = [ (Dict(str, int), Dict(int, str)), (Dict(str, Dict(str, int)), Dict(str, Dict(int, str))) ] test_hash(eq_tests, ne_tests)
def test_hash(self): from typecheck import Dict class A(object): pass eq_tests = [(Dict(str, int), Dict(str, int)), (Dict(str, A), Dict(str, A)), (Dict(str, Dict(str, int)), Dict(str, Dict(str, int)))] ne_tests = [(Dict(str, int), Dict(int, str)), (Dict(str, Dict(str, int)), Dict(str, Dict(int, str)))] self.multipleAssertEqualHashes(eq_tests, ne_tests)
def test_equality(self): from typecheck import Dict class A(object): pass eq_tests = [(Dict(str, int), Dict(str, int)), (Dict(str, A), Dict(str, A)), (Dict(str, Dict(str, int)), Dict(str, Dict(str, int)))] ne_tests = [(Dict(str, int), Dict(int, str)), (Dict(str, int), { 'a': 5 }), (Dict(str, Dict(str, int)), Dict(str, Dict(int, str)))] self.multipleAssertEqual(eq_tests, ne_tests)