Commits

Andriy Kornatskyy committed 0bd00f5

Refactored benchmark views to use BenchmarkMixin.

  • Participants
  • Parent commits bc72616

Comments (0)

Files changed (4)

demos/quickstart-empty/src/public/web/tests/benchmark_views.py

 """ ``benchmark_views`` module.
 """
 
-from wheezy.core.benchmark import Benchmark
+from wheezy.http.functional import BenchmarkMixin
 
 from public.web.tests.test_views import PublicTestCase
 from public.web.tests.test_views import ErrorTestCase
 
 
-class PublicBenchmarkTestCase(PublicTestCase, ErrorTestCase):
+class PublicBenchmarkTestCase(PublicTestCase, ErrorTestCase,
+                              BenchmarkMixin):
 
     def runTest(self):
         """ Perform bachmark and print results.
         """
-        b = Benchmark((
+        b = self.benchmark((
             self.test_root,
             self.test_home,
             self.test_error_400,
         })
 
 
-class StaticFilesBenchmarkTestCase(PublicTestCase, ErrorTestCase):
+class StaticFilesBenchmarkTestCase(PublicTestCase, ErrorTestCase,
+                                   BenchmarkMixin):
 
     def runTest(self):
         """ Perform bachmark and print results.
         """
-        b = Benchmark((
+        b = self.benchmark((
             self.test_static_files,
             self.test_static_file_not_found,
             self.test_static_file_forbidden

demos/quickstart-i18n/src/public/web/tests/benchmark_views.py

 """ ``benchmark_views`` module.
 """
 
-from wheezy.core.benchmark import Benchmark
+from wheezy.http.functional import BenchmarkMixin
 
 from public.web.tests.test_views import PublicTestCase
 from public.web.tests.test_views import ErrorTestCase
 
 
-class PublicBenchmarkTestCase(PublicTestCase, ErrorTestCase):
+class PublicBenchmarkTestCase(PublicTestCase, ErrorTestCase,
+                              BenchmarkMixin):
 
     def runTest(self):
         """ Perform bachmark and print results.
         """
-        b = Benchmark((
+        b = self.benchmark((
             self.test_root,
             self.test_home,
             self.test_error_400,
         })
 
 
-class StaticFilesBenchmarkTestCase(PublicTestCase, ErrorTestCase):
+class StaticFilesBenchmarkTestCase(PublicTestCase, ErrorTestCase,
+                                   BenchmarkMixin):
 
     def runTest(self):
         """ Perform bachmark and print results.
         """
-        b = Benchmark((
+        b = self.benchmark((
             self.test_static_files,
             self.test_static_file_not_found,
             self.test_static_file_forbidden

demos/template/src/membership/web/tests/benchmark_views.py

 """ ``benchmark_views`` module.
 """
 
-from wheezy.core.benchmark import Benchmark
+from wheezy.http.functional import BenchmarkMixin
 
 from membership.web.tests.test_views import MembershipTestCase
 from membership.web.tests.test_views import SignInTestCase
 from membership.web.tests.test_views import SignUpTestCase
 
 
-class MembershipBenchmarkTestCase(MembershipTestCase):
+class MembershipBenchmarkTestCase(MembershipTestCase, BenchmarkMixin):
 
     def runTest(self):
         """ Perform benchmark and print results.
         """
-        b = Benchmark((
+        b = self.benchmark((
             self.test_signin,
             self.test_signup,
             self.test_signout,
         })
 
 
-class SigninBenchmarkTestCase(SignInTestCase):
+class SigninBenchmarkTestCase(SignInTestCase, BenchmarkMixin):
 
     def runTest(self):
         """ Perform benchmark and print results.
         """
-        b = Benchmark((
+        b = self.benchmark((
             self.test_validation_error,
             self.test_unknown_user,
             self.test_xrsf_token_invalid
         })
 
 
-class SignupBenchmarkTestCase(SignUpTestCase):
+class SignupBenchmarkTestCase(SignUpTestCase, BenchmarkMixin):
 
     def runTest(self):
         """ Perform benchmark and print results.
         """
-        b = Benchmark((
+        b = self.benchmark((
             self.test_validation_error,
             self.test_already_registered,
             self.test_resubmission_token_invalid,

demos/template/src/public/web/tests/benchmark_views.py

 """ ``benchmark_views`` module.
 """
 
-from wheezy.core.benchmark import Benchmark
+from wheezy.http.functional import BenchmarkMixin
 
 from public.web.tests.test_views import PublicTestCase
 from public.web.tests.test_views import ErrorTestCase
 
 
-class PublicBenchmarkTestCase(PublicTestCase, ErrorTestCase):
+class PublicBenchmarkTestCase(PublicTestCase, ErrorTestCase, BenchmarkMixin):
 
     def runTest(self):
         """ Perform bachmark and print results.
         """
-        b = Benchmark((
+        b = self.benchmark((
             self.test_root,
             self.test_home,
             self.test_about,
         })
 
 
-class StaticFilesBenchmarkTestCase(PublicTestCase, ErrorTestCase):
+class StaticFilesBenchmarkTestCase(PublicTestCase, ErrorTestCase,
+                                   BenchmarkMixin):
 
     def runTest(self):
         """ Perform bachmark and print results.
         """
-        b = Benchmark((
+        b = self.benchmark((
             self.test_static_files,
             self.test_static_file_not_found,
             self.test_static_file_forbidden,