Example #1
0
  def test_select_all(self):
    self.assertEqual(
      self._q(query.select_all("foo", [{"foo": "bar"}, {"foo": "baz"}])),
      ["bar", "baz"]
    )

    self.assertEqual(
      self._q(query.select_all(["foo", 0], [{"foo": [0, 1]}, {"foo": [2, 3]}])),
      [0, 2]
    )
 def test_select_all(self):
     json = (
         '{"from":[{"object":{"foo":"bar"}},{"object":{"foo":"baz"}}],"select_all":"foo"}'
     )
     self.assertJson(
         query.select_all("foo", [{
             "foo": "bar"
         }, {
             "foo": "baz"
         }]), json)