def test_is_valid_json_file_invalid_fake_json_return_false(): file_output = ''' "enode://d4328d9a744b2770b4c46f5594c59f03e9c936538758cf53c119e1ff05c7cdb86e7ecfb107aa121d24c3342f2cb68090cea9e40d82f43f18c517215ae576b8ed@195.55.232.91:21000?discport=0", "enode://be6a6eef8c5ea5e64414126e0bdc10481543416ed3baf9bb10e66842f011404035291d6f93b2a770ce232a687bdaf5c2602d3cd8f696a835456d693f7947b3d3@51.138.52.113:21000?discport=0", "enode://0752557351410a2b31bb91a008c25510dccbbba53241937c77a061fe128c9e2102bbf3b7ee55cb85c37d980a85f5cf20ccde1f92bf10a12d68db8be78d3de705@52.50.15.212:21000?discport=0", ''' node_info = NodeInformation('1.2.3.4', 'myenode') validator = NodeValidator(node_info) is_valid = validator.is_valid_json_file(file_output, fake_json=True) assert not is_valid
def test_is_valid_json_file_valid_json_return_true(): file_output = ''' [ "https://137.117.233.65:9000/", "https://15.161.123.199:9000/", "https://195.55.232.91:9000/" ] ''' node_info = NodeInformation('1.2.3.4', 'myenode') validator = NodeValidator(node_info) is_valid = validator.is_valid_json_file(file_output) assert is_valid