From 5f39512edef09f1a6c88e73c170880761b096ba6 Mon Sep 17 00:00:00 2001 From: Duda Dornelles Date: Fri, 21 Nov 2014 14:46:10 -0200 Subject: Adding performance benchmark for GET /mails --- service/test/perf/mails/test_Mails.py | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 service/test/perf/mails/test_Mails.py (limited to 'service/test/perf/mails/test_Mails.py') diff --git a/service/test/perf/mails/test_Mails.py b/service/test/perf/mails/test_Mails.py new file mode 100644 index 00000000..b24ca5f4 --- /dev/null +++ b/service/test/perf/mails/test_Mails.py @@ -0,0 +1,45 @@ +# +# Copyright (c) 2014 ThoughtWorks, Inc. +# +# Pixelated is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Pixelated is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Pixelated. If not, see . +import unittest + +from funkload.FunkLoadTestCase import FunkLoadTestCase + +from test.support.integration import AppTestClient + + +class Mails(FunkLoadTestCase): + + def setUpBench(self): + client = AppTestClient() + client.add_multiple_to_mailbox(100, 'INBOX') + self.call_to_terminate = client.run_on_a_thread(logfile='results/app.log') + + def tearDownBench(self): + self.call_to_terminate() + + def setUp(self): + """Setting up test.""" + self.server_url = self.conf_get('main', 'url') + + def test_mails(self): + server_url = self.server_url + nb_time = self.conf_getInt('main', 'nb_time') + + for i in range(nb_time): + self.get(server_url, description='Get Mails') + +if __name__ in ('main', '__main__'): + unittest.main() -- cgit v1.2.3