def test_list_users_query(self): map = RequestMap() map.set("max", "10") response = User.listByCriteria(map) ignoreAsserts = [] self.customAssertEqual(ignoreAsserts, "website", response.get("list[0].website"),"hildegard.org") self.customAssertEqual(ignoreAsserts, "address.instructions.doorman", response.get("list[0].address.instructions.doorman"),"true") self.customAssertEqual(ignoreAsserts, "address.instructions.text", response.get("list[0].address.instructions.text"),"some delivery instructions text") self.customAssertEqual(ignoreAsserts, "address.city", response.get("list[0].address.city"),"New York") self.customAssertEqual(ignoreAsserts, "address.postalCode", response.get("list[0].address.postalCode"),"10577") self.customAssertEqual(ignoreAsserts, "address.id", response.get("list[0].address.id"),"1") self.customAssertEqual(ignoreAsserts, "address.state", response.get("list[0].address.state"),"NY") self.customAssertEqual(ignoreAsserts, "address.line1", response.get("list[0].address.line1"),"2000 Purchase Street") self.customAssertEqual(ignoreAsserts, "phone", response.get("list[0].phone"),"1-770-736-8031") self.customAssertEqual(ignoreAsserts, "name", response.get("list[0].name"),"Joe Bloggs") self.customAssertEqual(ignoreAsserts, "id", response.get("list[0].id"),"1") self.customAssertEqual(ignoreAsserts, "email", response.get("list[0].email"),"*****@*****.**") self.customAssertEqual(ignoreAsserts, "username", response.get("list[0].username"),"jbloggs") BaseTest.putResponse("list_users_query", response.get("list[0]"))
def test_get_user_query(self): id = "" map = RequestMap() map.set("min", "1") map.set("max", "10") map.set("id", BaseTest.resolveResponseValue("create_user.id")); response = User.read(id,map) ignoreAsserts = [] self.customAssertEqual(ignoreAsserts, "website", response.get("website"),"hildegard.org") self.customAssertEqual(ignoreAsserts, "address.instructions.doorman", response.get("address.instructions.doorman"),"true") self.customAssertEqual(ignoreAsserts, "address.instructions.text", response.get("address.instructions.text"),"some delivery instructions text") self.customAssertEqual(ignoreAsserts, "address.city", response.get("address.city"),"New York") self.customAssertEqual(ignoreAsserts, "address.postalCode", response.get("address.postalCode"),"10577") self.customAssertEqual(ignoreAsserts, "address.id", response.get("address.id"),"1") self.customAssertEqual(ignoreAsserts, "address.state", response.get("address.state"),"NY") self.customAssertEqual(ignoreAsserts, "address.line1", response.get("address.line1"),"2000 Purchase Street") self.customAssertEqual(ignoreAsserts, "phone", response.get("phone"),"1-770-736-8031") self.customAssertEqual(ignoreAsserts, "name", response.get("name"),"Joe Bloggs") self.customAssertEqual(ignoreAsserts, "id", response.get("id"),"1") self.customAssertEqual(ignoreAsserts, "email", response.get("email"),"*****@*****.**") self.customAssertEqual(ignoreAsserts, "username", response.get("username"),"jbloggs") BaseTest.putResponse("get_user_query", response)
def test_delete_user_posts_with_mutplie_path(self): map = RequestMap() map.set("user_id", "1") map.set("post_id", "2") response = MultiplePathUserPost.deleteById("", map) self.assertNotEqual(response, None) ignoreAsserts = [] BaseTest.putResponse("delete_user_posts_with_mutplie_path", response)
def test_update_user_posts_with_mutplie_path(self): map = RequestMap() map.set("user_id", "1") map.set("post_id", "1") map.set("testQuery", "testQuery") map.set("name", "Joe Bloggs") map.set("username", "jbloggs") map.set("email", "*****@*****.**") map.set("phone", "1-770-736-8031") map.set("website", "hildegard.org") map.set("address.line1", "2000 Purchase Street") map.set("address.city", "New York") map.set("address.state", "NY") map.set("address.postalCode", "10577") response = MultiplePathUserPost(map).update() ignoreAsserts = [] self.customAssertEqual(ignoreAsserts, "website", response.get("website"), "hildegard.org") self.customAssertEqual(ignoreAsserts, "address.instructions.doorman", response.get("address.instructions.doorman"), "true") self.customAssertEqual(ignoreAsserts, "address.instructions.text", response.get("address.instructions.text"), "some delivery instructions text") self.customAssertEqual(ignoreAsserts, "address.city", response.get("address.city"), "New York") self.customAssertEqual(ignoreAsserts, "address.postalCode", response.get("address.postalCode"), "10577") self.customAssertEqual(ignoreAsserts, "address.id", response.get("address.id"), "1") self.customAssertEqual(ignoreAsserts, "address.state", response.get("address.state"), "NY") self.customAssertEqual(ignoreAsserts, "address.line1", response.get("address.line1"), "2000 Purchase Street") self.customAssertEqual(ignoreAsserts, "phone", response.get("phone"), "1-770-736-8031") self.customAssertEqual(ignoreAsserts, "name", response.get("name"), "Joe Bloggs") self.customAssertEqual(ignoreAsserts, "id", response.get("id"), "1") self.customAssertEqual(ignoreAsserts, "email", response.get("email"), "*****@*****.**") self.customAssertEqual(ignoreAsserts, "username", response.get("username"), "jbloggs") BaseTest.putResponse("update_user_posts_with_mutplie_path", response)
def test_delete_user_204(self): map = RequestMap() map.set("id", BaseTest.resolveResponseValue("create_user.id")); response = User.delete204ById("ssss",map) self.assertNotEqual(response,None) ignoreAsserts = [] BaseTest.putResponse("delete_user_204", response)
def test_update_user(self): map = RequestMap() map.set("name", "Joe Bloggs") map.set("username", "jbloggs") map.set("email", "*****@*****.**") map.set("phone", "1-770-736-8031") map.set("website", "hildegard.org") map.set("address.line1", "2000 Purchase Street") map.set("address.city", "New York") map.set("address.state", "NY") map.set("address.postalCode", "10577") map.set("id", BaseTest.resolveResponseValue("create_user.id")); map.set("id2", BaseTest.resolveResponseValue("create_user.id")); map.set("prepend", "prepend"+BaseTest.resolveResponseValue("create_user.id")); map.set("append", BaseTest.resolveResponseValue("create_user.id")+"append"); map.set("complex", "prepend-"+BaseTest.resolveResponseValue("create_user.id")+"-"+BaseTest.resolveResponseValue("create_user.name")); map.set("name", BaseTest.resolveResponseValue("val:Andrea Rizzini")); response = User(map).update() ignoreAsserts = [] self.customAssertEqual(ignoreAsserts, "website", response.get("website"),"hildegard.org") self.customAssertEqual(ignoreAsserts, "address.instructions.doorman", response.get("address.instructions.doorman"),"true") self.customAssertEqual(ignoreAsserts, "address.instructions.text", response.get("address.instructions.text"),"some delivery instructions text") self.customAssertEqual(ignoreAsserts, "address.city", response.get("address.city"),"New York") self.customAssertEqual(ignoreAsserts, "address.postalCode", response.get("address.postalCode"),"10577") self.customAssertEqual(ignoreAsserts, "address.id", response.get("address.id"),"1") self.customAssertEqual(ignoreAsserts, "address.state", response.get("address.state"),"NY") self.customAssertEqual(ignoreAsserts, "address.line1", response.get("address.line1"),"2000 Purchase Street") self.customAssertEqual(ignoreAsserts, "phone", response.get("phone"),"1-770-736-8031") self.customAssertEqual(ignoreAsserts, "name", response.get("name"),"Joe Bloggs") self.customAssertEqual(ignoreAsserts, "id", response.get("id"),"1") self.customAssertEqual(ignoreAsserts, "email", response.get("email"),"*****@*****.**") self.customAssertEqual(ignoreAsserts, "username", response.get("username"),"jbloggs") BaseTest.putResponse("update_user", response)
def test_get_user_posts_with_path(self): map = RequestMap() map.set("user_id", "1") response = UserPostPath.listByCriteria(map) ignoreAsserts = [] self.customAssertEqual(ignoreAsserts, "id", response.get("list[0].id"), "1") self.customAssertEqual(ignoreAsserts, "title", response.get("list[0].title"), "My Title") self.customAssertEqual(ignoreAsserts, "body", response.get("list[0].body"), "some body text") self.customAssertEqual(ignoreAsserts, "userId", response.get("list[0].userId"), "1") BaseTest.putResponse("get_user_posts_with_path", response.get("list[0]"))