refindlyllc / rets

A thin RETS client
MIT License
69 stars 26 forks source link

Check lookup key if lookuptype key is not present #207

Closed REWEvanSeabrook closed 5 years ago

REWEvanSeabrook commented 5 years ago

Description

Some feeds seem to return Lookup instead of LookupType when requesting lookup value metadata. This is a case that phRETS already handles, and I've more or less copied the solution here.

I've tested this against several feeds: one that returns the expected LookupType key, and one that doesn't.

mcrowson commented 5 years ago

Awesome! Do you happen to have an example response? I'd love to have a test for this if you don't mind adding one.

REWEvanSeabrook commented 5 years ago

@mcrowson certainly! Please view the example response here: https://github.com/refindlyllc/rets/blob/56271b48ec1a6282ee7fc36dec0b5afaf2661e68/tests/rets_responses/STANDARD-XML/GetMetadata_lookup2.xml

I've gone ahead and included it into a new test (test_alternative_lookup_type_metadata), which I've rolled into this commit.

mcrowson commented 5 years ago

Thanks for the contribution!

mcrowson commented 5 years ago

Uploaded 0.4.9 which should have this change.

REWEvanSeabrook commented 5 years ago

Confirmed working after pulling in 0.4.9 -- thanks for your attention into this! @mcrowson