-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added name_or_id to the property retrieval, updated tests
* updated all casettes * small refactoring in the part tests * updated all tests * added tests for getting the property by id and name
- Loading branch information
Jochem Berends
committed
Jan 24, 2018
1 parent
0afd4c7
commit 94730dc
Showing
36 changed files
with
88 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...assettes/TestPartCreateWithProperties.test_create_part_with_properties_ids_with_bulk.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"recorded_with": "betamax/0.8.0", "http_interactions": [{"response": {"status": {"message": "OK", "code": 200}, "body": {"base64_string": "H4sIAAAAAAAAA61TTYvbMBD9K4tOLUSJLPlLOW277aFQaKFLDy1LkKVx4o0tB0nedgn57x0l9pLNHlrogm0s6b03o5k3e+LAD23wZPlzTwbXkiXZhLDzy8ViC5qrXTPfAtUb1di57rsFbiy87nfgF3ldVFrWjHJeAk2NUFQazSjoTBWZKQQkZn7ve0tmpDEo/C8ExFrVAaLfN1u4+ur6e9Dh6s3uEdOJWVwF8KGx67eIDPA7IBL/fFBhwEuQdze3n75/jGdOWd+Eprenu42qN5+/fIvHm2a9afENgJkFN8CZxhHzgRzuZkR536wtINMObTsjHXQVuLFaHtyoGnPqlFVrcPGyfqV0aB5gUsaNE3HaGGkn7EQcz6BTTWxDdV3NbTvWjh9mLwLG5X9Eq1Xrz8Kp83DiItxT9V/tdmOg4iLQfa830M1RDKzxrxbtuew1OvpX77Y+OnpMJI/dRge4sDIqREHOkoKyhPL8loslY/j8QLAZ4C+IatBbQF/uSdcbaFeu76NLC8mV0BVQJrIc3S9TWqZlTSutq7oSnNVaxGQsZmE1TLQ644kQAqhKwNAU8oxWSZ5TKWUtEyVKXSfTgKWMoTgvaIKTS9MiV7TkBQ5YVWQFh1wCMHKYkZ3rNfhodWYUZFJIWgqhaVoWilYyTynLTKoFyBq0JEfC2h0ZbJ5louCMi5LJDL8Cq2yaoKr2qUU7cF2Dg3McvT3RDo71Gg037GL5Vg66/gEuenmCrnTb2xcEZcwFGsFPw3sOeu6B08m0Mjg4rn+8oE3JnDMPh7vDH6N+rtwfBQAA", "string": "", "encoding": null}, "url": "<API_URL>/api/scopes.json?status=ACTIVE&name=Bike+Project+%28pykechain+testing%29", "headers": {"Allow": "GET, POST, HEAD, OPTIONS", "Transfer-Encoding": "chunked", "Vary": "Accept-Encoding", "Connection": "keep-alive", "X-XSS-Protection": "1; mode=block", "Date": "Wed, 24 Jan 2018 12:44:03 GMT", "X-Content-Type-Options": "nosniff", "Content-Type": "application/json", "Content-Encoding": "gzip", "X-Frame-Options": "SAMEORIGIN", "Strict-Transport-Security": "max-age=518400; includeSubDomains", "Server": "nginx/1.12.2"}}, "request": {"method": "GET", "uri": "<API_URL>/api/scopes.json?status=ACTIVE&name=Bike+Project+%28pykechain+testing%29", "body": {"string": "", "encoding": "utf-8"}, "headers": {"Accept": "*/*", "User-Agent": "python-requests/2.18.4", "Authorization": "Token <AUTH_TOKEN>", "Connection": "keep-alive", "Accept-Encoding": "gzip, deflate", "PyKechain-Version": "1.14.2", "X-Requested-With": "XMLHttpRequest"}}, "recorded_at": "2018-01-24T12:44:03"}, {"response": {"status": {"message": "OK", "code": 200}, "body": {"base64_string": "H4sIAAAAAAAAA9VY224bORL9FaOfTZv3i18GGkeZMdZjB7FmZ4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JApllUoW02mGnb3V1Amt7kVMkb6cIQwYiOmi6sp5Vcay65dzfrZcyV2PzXQx7l9uNgJy4ttxuwh3k2w3016/WF6obtowqtMScVkX+eXFGVb59c/2pvTO1WLen6vGfj6vbsblrO36A/DGGlK1a+qb+9eId2/XQ3v/49WiV+3YKd27uYPxDK7Hy0U9crHusGH6A1fLgQ+HrPyuhejtp9u/APbqfB3ZFgAA", "string": "", "encoding": null}, "url": "<API_URL>/api/parts.json?name=Bike&limit=100&category=INSTANCE&bucket=40003527-1c2a-476a-8270-eb7572e69ee0", "headers": {"Allow": "GET, POST, HEAD, OPTIONS", "Transfer-Encoding": "chunked", "Vary": "Accept-Encoding", "Connection": "keep-alive", "X-XSS-Protection": "1; mode=block", "Date": "Wed, 24 Jan 2018 12:44:03 GMT", "X-Content-Type-Options": "nosniff", "Content-Type": "application/json", "Content-Encoding": "gzip", "X-Frame-Options": "SAMEORIGIN", "Strict-Transport-Security": "max-age=518400; includeSubDomains", "Server": "nginx/1.12.2"}}, "request": {"method": "GET", "uri": "<API_URL>/api/parts.json?name=Bike&limit=100&category=INSTANCE&bucket=40003527-1c2a-476a-8270-eb7572e69ee0", "body": {"string": "", "encoding": "utf-8"}, "headers": {"Accept": "*/*", "User-Agent": "python-requests/2.18.4", "Authorization": "Token <AUTH_TOKEN>", "Connection": "keep-alive", "Accept-Encoding": "gzip, deflate", "PyKechain-Version": "1.14.2", "X-Requested-With": "XMLHttpRequest"}}, "recorded_at": "2018-01-24T12:44:03"}, {"response": {"status": {"message": "OK", "code": 200}, "body": {"base64_string": "H4sIAAAAAAAAA82Uy27bMBBFfyXQ2oytF0V55yYpWiCJA9dp0RaBwMeoZi1LAkW1MQL/e0cvG068SJFNVvJwOHd4D+l5cmRR59aZuiMnh0f8kddZNnJKA390UVdDbKCqM4vhzydHK2fqgJIMBJ+QIJIhCdxQERZ5EaEq9qIw8AF84Yyc2mS4eWVtWU3H4zVIj5f6fA1ErrjOz2WxGePCuOTGVuPXaJ7/roochXO+AVT+tgLIMFRQSaNLqzE5dXBBrnSmkk2hINubaKODw6IEYzV0piS38KswW6y+mV9eXZ/S7HteavxaMM5eZJvYbdmkPl7PZ8vk6+z6/qoxn+s90KK2ZY2RNTVg1Kpi56fdyKlwTdrawKBy16s2DRDM62kfGSyMwjNOJ6PuwlgcCcEUI2msFAmk8IiQoUtowBhEfuCHLEKJPzyroZPYjf4Ly5eyWCPMl1A+374zJG6PJE1TX06oR9LQZyQARomgHiOejCAII9+TQr0JyUJvzm5wu9E8OwHm4tNs8b7IeD0ZLxJSxS4jkzj2SOBxQWLFJkQwKUWcRh4N3/ZYltrA2XKl5TqH6tSjeYf/JL+HA65yuUwpCVKKEpS6hDM3JD6XMfUnykOlZ3AeRqfgyIxXlU41pjo+d4v55f3FsuWWgeUig8EnKH0UH1N4abxx25qGZrr3Qzv0FQ1ACOJOcBAEVDB88DQmknuUcVDUd/3DHX3Qa3CQ6gYnvy4zLbVtTv/jajFPbma33xsHRW5xjjd0Up5V0N7j43YAt+JVUtVif7pqOG+faMf+oRTMRiOQ7jodaQCRJcPnMM8HkbpUTYaXZbZNdF5Znss9H3x41hTbIexUnlU27ZPObLeOm9RxRZLD36T19KJDv2F4uCfqnld0bbtot3vY/QOVEaAvfQcAAA==", "string": "", "encoding": null}, "url": "<API_URL>/api/parts.json?name=Wheel&limit=100&category=MODEL&bucket=40003527-1c2a-476a-8270-eb7572e69ee0", "headers": {"Allow": "GET, POST, HEAD, OPTIONS", "Transfer-Encoding": "chunked", "Vary": "Accept-Encoding", "Connection": "keep-alive", "X-XSS-Protection": "1; mode=block", "Date": "Wed, 24 Jan 2018 12:44:03 GMT", "X-Content-Type-Options": "nosniff", "Content-Type": "application/json", "Content-Encoding": "gzip", "X-Frame-Options": "SAMEORIGIN", "Strict-Transport-Security": "max-age=518400; includeSubDomains", "Server": "nginx/1.12.2"}}, "request": {"method": "GET", "uri": "<API_URL>/api/parts.json?name=Wheel&limit=100&category=MODEL&bucket=40003527-1c2a-476a-8270-eb7572e69ee0", "body": {"string": "", "encoding": "utf-8"}, "headers": {"Accept": "*/*", "User-Agent": "python-requests/2.18.4", "Authorization": "Token <AUTH_TOKEN>", "Connection": "keep-alive", "Accept-Encoding": "gzip, deflate", "PyKechain-Version": "1.14.2", "X-Requested-With": "XMLHttpRequest"}}, "recorded_at": "2018-01-24T12:44:03"}, {"response": {"status": {"message": "Created", "code": 201}, "body": {"string": "{\"results\":[{\"id\":\"cc89e8ff-96ae-4656-a9a5-d48b73c4acd0\",\"name\":\"Fresh Wheel\",\"description\":\"\",\"child_models\":[],\"properties\":[{\"options\":{},\"property_type\":\"FLOAT_VALUE\",\"order\":0,\"name\":\"Diameter\",\"model\":\"897bb8d8-f9dd-4cb2-bc51-6488e7343587\",\"description\":\"\",\"output\":true,\"part\":\"cc89e8ff-96ae-4656-a9a5-d48b73c4acd0\",\"id\":\"268a0efa-cfcd-44cc-86c3-4742e3130dcb\",\"value\":42.43,\"structure_type\":\"Property\",\"category\":\"INSTANCE\",\"unit\":null},{\"options\":{},\"property_type\":\"INT_VALUE\",\"order\":1,\"name\":\"Spokes\",\"model\":\"fff3c062-f538-4e86-b628-2c7e45732cbd\",\"description\":\"\",\"output\":true,\"part\":\"cc89e8ff-96ae-4656-a9a5-d48b73c4acd0\",\"id\":\"1ca1b8a8-5f56-4151-9541-9f87d48f543d\",\"value\":42,\"structure_type\":\"Property\",\"category\":\"INSTANCE\",\"unit\":null},{\"options\":{},\"property_type\":\"CHAR_VALUE\",\"order\":2,\"name\":\"Rim Material\",\"model\":\"27bcd918-0992-42ab-9d80-b8ccb9f72657\",\"description\":\"\",\"output\":true,\"part\":\"cc89e8ff-96ae-4656-a9a5-d48b73c4acd0\",\"id\":\"fab03afa-7510-486b-be79-d78e424384e4\",\"value\":\"Unobtanium\",\"structure_type\":\"Property\",\"category\":\"INSTANCE\",\"unit\":null},{\"options\":{},\"property_type\":\"FLOAT_VALUE\",\"order\":3,\"name\":\"Tire Thickness\",\"model\":\"e1d1acf6-4f65-4661-a815-3ac9630d2927\",\"description\":\"\",\"output\":true,\"part\":\"cc89e8ff-96ae-4656-a9a5-d48b73c4acd0\",\"id\":\"b9bac0e7-7b60-4188-baba-1dad50985c78\",\"value\":null,\"structure_type\":\"Property\",\"category\":\"INSTANCE\",\"unit\":null}],\"category\":\"INSTANCE\",\"model\":{\"id\":\"edc8eba0-47c5-415d-8727-6d927543ee3b\",\"name\":\"Wheel\"},\"classification\":\"PRODUCT\",\"deletable\":true,\"editable\":true,\"created_at\":\"2018-01-24T12:44:03.956675Z\",\"updated_at\":\"2018-01-24T12:44:03.956686Z\",\"output\":true,\"structure_type\":\"Part\",\"parent\":{\"id\":\"e5106946-40f7-4b49-ae5e-421450857911\",\"name\":\"Bike\"},\"multiplicity\":\"ZERO_MANY\",\"container\":false,\"proxy\":null,\"permissions\":{\"update_apply_instance\":true,\"create\":true,\"create_new_instance\":true,\"create_property\":false,\"create_new_proxy_instance\":true,\"create_create_child_model\":false,\"update_part_name\":true,\"update\":true,\"destroy\":true,\"read\":true},\"has_subparts\":false}]}", "encoding": null}, "url": "<API_URL>/api/parts.json?select_action=new_instance_with_properties", "headers": {"Allow": "GET, POST, HEAD, OPTIONS", "Transfer-Encoding": "chunked", "Vary": "Accept, Cookie", "Connection": "keep-alive", "X-XSS-Protection": "1; mode=block", "Date": "Wed, 24 Jan 2018 12:44:04 GMT", "X-Content-Type-Options": "nosniff", "Content-Type": "application/json", "X-Frame-Options": "SAMEORIGIN", "Strict-Transport-Security": "max-age=518400; includeSubDomains", "Server": "nginx/1.12.2"}}, "request": {"method": "POST", "uri": "<API_URL>/api/parts.json?select_action=new_instance_with_properties", "body": {"string": "model=edc8eba0-47c5-415d-8727-6d927543ee3b&properties=%7B%22897bb8d8-f9dd-4cb2-bc51-6488e7343587%22%3A+42.43%2C+%22fff3c062-f538-4e86-b628-2c7e45732cbd%22%3A+42%2C+%2227bcd918-0992-42ab-9d80-b8ccb9f72657%22%3A+%22Unobtanium%22%7D&parent=e5106946-40f7-4b49-ae5e-421450857911&name=Fresh+Wheel", "encoding": "utf-8"}, "headers": {"Accept": "*/*", "Content-Length": "290", "User-Agent": "python-requests/2.18.4", "Authorization": "Token <AUTH_TOKEN>", "Connection": "keep-alive", "Accept-Encoding": "gzip, deflate", "PyKechain-Version": "1.14.2", "X-Requested-With": "XMLHttpRequest", "Content-Type": "application/x-www-form-urlencoded"}}, "recorded_at": "2018-01-24T12:44:04"}, {"response": {"status": {"message": "No Content", "code": 204}, "body": {"string": "", "encoding": null}, "url": "<API_URL>/api/parts/cc89e8ff-96ae-4656-a9a5-d48b73c4acd0.json", "headers": {"Allow": "GET, PUT, PATCH, DELETE, HEAD, OPTIONS", "Connection": "keep-alive", "Content-Length": "0", "Vary": "Accept, Cookie", "X-Content-Type-Options": "nosniff", "X-XSS-Protection": "1; mode=block", "Date": "Wed, 24 Jan 2018 12:44:04 GMT", "Content-Type": "application/json", "X-Frame-Options": "SAMEORIGIN", "Strict-Transport-Security": "max-age=518400; includeSubDomains", "Server": "nginx/1.12.2"}}, "request": {"method": "DELETE", "uri": "<API_URL>/api/parts/cc89e8ff-96ae-4656-a9a5-d48b73c4acd0.json", "body": {"string": "", "encoding": "utf-8"}, "headers": {"Accept": "*/*", "Content-Length": "0", "User-Agent": "python-requests/2.18.4", "Authorization": "Token <AUTH_TOKEN>", "Connection": "keep-alive", "Accept-Encoding": "gzip, deflate", "PyKechain-Version": "1.14.2", "X-Requested-With": "XMLHttpRequest"}}, "recorded_at": "2018-01-24T12:44:04"}]} |
Oops, something went wrong.