Esempio n. 1
0
 def test_list(self):
     """Simple list should return api call"""
     self.request.db = MagicMock()
     self.request.db.distinct.return_value = ["a", "b", "c"]
     self.request.access.has_permission.side_effect = lambda x, _: x == "b"
     result = simple(self.request)
     self.assertEqual(result, {"pkgs": ["b"]})
Esempio n. 2
0
 def test_list(self):
     """ Simple list should return api call """
     self.request.db = MagicMock()
     self.request.db.distinct.return_value = ["a", "b", "c"]
     self.request.access.has_permission.side_effect = lambda x, _: x == "b"
     result = simple(self.request)
     self.assertEqual(result, {"pkgs": ["b"]})
Esempio n. 3
0
 def test_list(self):
     """ Simple list should return api call """
     self.request.db = MagicMock()
     self.request.db.distinct.return_value = ['a', 'b', 'c']
     self.request.access.has_permission.side_effect = lambda x, _: x == 'b'
     result = simple(self.request)
     self.assertEqual(result, {'pkgs': ['b']})
Esempio n. 4
0
 def test_list(self):
     """ Simple list should return api call """
     self.request.db = MagicMock()
     self.request.db.distinct.return_value = ['a', 'b', 'c']
     self.request.access.has_permission.side_effect = lambda x, _: x == 'b'
     result = simple(self.request)
     self.assertEqual(result, {'pkgs': ['b']})