Пример #1
0
 def test_dict_positional_with_other_kwargs():
     args = ({"flat": ("OtherKind", "Cheese"), "app": "ehp"}, )
     kwargs = {"namespace": "over-here"}
     with pytest.raises(TypeError):
         key_module._constructor_handle_positional(args, kwargs)
Пример #2
0
 def test_path_collide_flat():
     args = ("Kind", 1)
     kwargs = {"flat": ("OtherKind", "Cheese")}
     with pytest.raises(TypeError):
         key_module._constructor_handle_positional(args, kwargs)
Пример #3
0
 def test_dict_positional():
     args = ({"flat": ("OtherKind", "Cheese"), "app": "ehp"}, )
     kwargs = {}
     key_module._constructor_handle_positional(args, kwargs)
     assert kwargs == args[0]
Пример #4
0
 def test_with_path():
     args = ("Kind", 1)
     kwargs = {}
     key_module._constructor_handle_positional(args, kwargs)
     assert kwargs == {"flat": args}
Пример #5
0
 def test_dict_positional_with_other_kwargs():
     args = ({"flat": ("OtherKind", "Cheese"), "app": "ehp"},)
     kwargs = {"namespace": "over-here"}
     with pytest.raises(TypeError):
         key_module._constructor_handle_positional(args, kwargs)
Пример #6
0
 def test_dict_positional():
     args = ({"flat": ("OtherKind", "Cheese"), "app": "ehp"},)
     kwargs = {}
     key_module._constructor_handle_positional(args, kwargs)
     assert kwargs == args[0]
Пример #7
0
 def test_path_collide_flat():
     args = ("Kind", 1)
     kwargs = {"flat": ("OtherKind", "Cheese")}
     with pytest.raises(TypeError):
         key_module._constructor_handle_positional(args, kwargs)
Пример #8
0
 def test_with_path():
     args = ("Kind", 1)
     kwargs = {}
     key_module._constructor_handle_positional(args, kwargs)
     assert kwargs == {"flat": args}