コード例 #1
0
ファイル: test_rest.py プロジェクト: harinakshi/simpl
 def test_paginated_decoration(self):
     """Test decorated function is called."""
     mock_handler = mock.Mock(return_value={})
     mock_handler.__name__ = "fxn"
     decorated = rest.paginated('widget')(mock_handler)
     self.assertTrue(callable(decorated))
     self.assertEqual(decorated(), {})
     mock_handler.assert_called_once_with()
コード例 #2
0
ファイル: test_rest.py プロジェクト: griffinb/simpl
 def test_paginated_decoration(self):
     """Test decorated function is called."""
     mock_handler = mock.Mock(return_value={})
     mock_handler.__name__ = "fxn"
     decorated = rest.paginated('widget')(mock_handler)
     self.assertTrue(callable(decorated))
     self.assertEqual(decorated(), {})
     mock_handler.assert_called_once_with()
コード例 #3
0
ファイル: test_rest.py プロジェクト: harinakshi/simpl
 def test_paginated_validation(self):
     mock_handler = mock.Mock(return_value={})
     mock_handler.__name__ = "fxn"
     decorated = rest.paginated('widget')(mock_handler)
     self.assertIsNone(decorated(limit='invalid'))
     mock_handler.assert_not_called()
コード例 #4
0
ファイル: test_rest.py プロジェクト: griffinb/simpl
 def test_paginated_validation(self):
     mock_handler = mock.Mock(return_value={})
     mock_handler.__name__ = "fxn"
     decorated = rest.paginated('widget')(mock_handler)
     self.assertIsNone(decorated(limit='invalid'))
     mock_handler.assert_not_called()