def test_create_row_using_name_compartment(self): nosql_row = UpdateRowDetails() nosql_row.value = { "first": "not-value", "second": 1, "third": True, } nosql_row.compartment_id = self.oci_config["compartment_id"] self.nosql_cli.update_row(table_name_or_id=self.table_name, update_row_details=nosql_row) response = self.nosql_cli.get_row( table_name_or_id=self.table_name, key=["first:not-value", "second:1"], compartment_id=self.oci_config["compartment_id"], ) self.assertEquals(response.data.value["first"], "not-value") self.assertEquals(response.data.value["second"], 1) self.assertEquals(response.data.value["third"], True) query = f"SELECT * FROM {self.table_name} WHERE third = true" details = QueryDetails( compartment_id=self.oci_config["compartment_id"], statement=query) response = self.nosql_cli.query(details) self.assertEquals(len(response.data.items), 1)
def test_get_row_not_key(self): nosql_row = UpdateRowDetails() nosql_row.value = {"first": "not-value", "second": 1, "third": True} self.nosql_cli.update_row(table_name_or_id=self.table_id, update_row_details=nosql_row) response = self.nosql_cli.get_row( table_name_or_id=self.table_name, compartment_id=self.oci_config["compartment_id"], key=["dump:value"], ) self.assertEquals(response.data.value, None)