def test_interfaces_wrong_suffix(): input_json = {'interfaces': {'foo.abi': {'content': FOO_CODE}}} with pytest.raises(JSONError): get_input_dict_interfaces(input_json) input_json = {'interfaces': {'interface.folder/foo': {'content': FOO_CODE}}} with pytest.raises(JSONError): get_input_dict_interfaces(input_json)
def test_interface_collision(): input_json = { 'interfaces': { '/bar.json': {'abi': BAR_ABI}, 'bar.vy': {'content': BAR_CODE} } } with pytest.raises(JSONError): get_input_dict_interfaces(input_json)
def test_interface_collision(): input_json = { "interfaces": { "/bar.json": { "abi": BAR_ABI }, "bar.vy": { "content": BAR_CODE } } } with pytest.raises(JSONError): get_input_dict_interfaces(input_json)
def test_interfaces_wrong_suffix(): input_json = {"interfaces": {"foo.abi": {"content": FOO_CODE}}} with pytest.raises(JSONError): get_input_dict_interfaces(input_json) input_json = { "interfaces": { "interface.folder/foo": { "content": FOO_CODE } } } with pytest.raises(JSONError): get_input_dict_interfaces(input_json)
def test_interfaces_output(): input_json = { 'interfaces': { '/bar.json': {'abi': BAR_ABI}, '/interface.folder/bar2.vy': {'content': BAR_CODE} } } result = get_input_dict_interfaces(input_json) assert isinstance(result, dict) assert result == { 'bar': {'type': "json", 'code': BAR_ABI}, 'interface.folder/bar2': {'type': "vyper", 'code': BAR_CODE} }
def test_manifest_output(): input_json = { "interfaces": { "/bar.json": { "contractTypes": { "Bar": { "abi": BAR_ABI } } }, } } result = get_input_dict_interfaces(input_json) assert isinstance(result, dict) assert result == {"Bar": {"type": "json", "code": BAR_ABI}}
def test_interfaces_output(): input_json = { "interfaces": { "/bar.json": { "abi": BAR_ABI }, "/interface.folder/bar2.vy": { "content": BAR_CODE }, } } result = get_input_dict_interfaces(input_json) assert isinstance(result, dict) assert result == { "bar": { "type": "json", "code": BAR_ABI }, "interface.folder/bar2": { "type": "vyper", "code": BAR_CODE }, }
def test_vy_no_content(): input_json = {"interfaces": {"bar.vy": {"abi": BAR_CODE}}} with pytest.raises(JSONError): get_input_dict_interfaces(input_json)
def test_json_no_abi(): input_json = {"interfaces": {"bar.json": {"content": BAR_ABI}}} with pytest.raises(JSONError): get_input_dict_interfaces(input_json)
def test_no_interfaces(): result = get_input_dict_interfaces({}) assert isinstance(result, dict) assert not result
def test_vy_no_content(): input_json = {'interfaces': {'bar.vy': {'abi': BAR_CODE}}} with pytest.raises(JSONError): get_input_dict_interfaces(input_json)
def test_json_no_abi(): input_json = {'interfaces': {'bar.json': {'content': BAR_ABI}}} with pytest.raises(JSONError): get_input_dict_interfaces(input_json)