Ejemplo n.º 1
0
 def test_send_mass_continuation_prohibited(self):
     args_list = self.get_args_list(["test", "next", "404"])
     kwargs_list = self.get_kwargs_list(["test", "next", "404"])
     scc, err = send_mass(args_list,
                          kwargs_list,
                          method=self.method,
                          config=self.config,
                          session=MockRequests)
     self.check_results(scc, 2)
     self.check_results(err, 1)
Ejemplo n.º 2
0
 def test_send_mass(self):
     args_list = self.get_args_list(["test", "test2", "404"])
     kwargs_list = self.get_kwargs_list(["test", "test2", "404"])
     start = datetime.now()
     scc, err = send_mass(args_list, kwargs_list, method=self.method, config=self.config, session=MockRequests)
     end = datetime.now()
     duration = (end - start).total_seconds()
     self.assertLess(duration, 0.1)
     self.check_results(scc, 2)
     self.check_results(err, 1)
Ejemplo n.º 3
0
 def test_send_mass_intervals(self):
     self.config.interval_duration = 250  # 0.25 secs
     args_list = self.get_args_list(["test", "test2"])
     kwargs_list = self.get_kwargs_list(["test", "test2"])
     start = datetime.now()
     scc, err = send_mass(args_list, kwargs_list, method=self.method, config=self.config, session=MockRequests)
     end = datetime.now()
     duration = (end - start).total_seconds()
     self.assertGreater(duration, 0.5)
     self.assertLess(duration, 1)
     self.check_results(scc, 2)
     self.check_results(err, 0)
Ejemplo n.º 4
0
 def test_send_mass_concat_arguments(self, send_serie):
     self.config.concat_args_size = 3
     self.config.concat_args_symbol = "|"
     scc, err = send_mass([[1], [2], [3], [4], [5, 5], [6], [7]],
                          [{}, {}, {}, {}, {}, {}, {}],
                          method=self.method,
                          config=self.config,
                          session=MockRequests)
     send_serie.assert_called_with([["1|2|3"], ["4|5|5|6"], ["7"]],
                                   [{}, {}, {}],
                                   method=self.method,
                                   config=self.config,
                                   session=MockRequests)
Ejemplo n.º 5
0
 def test_send_mass_continuation(self):
     self.config.continuation_limit = 10
     args_list = self.get_args_list(["test", "next", "404"])
     kwargs_list = self.get_kwargs_list(["test", "next", "404"])
     scc, err = send_mass(
         args_list,
         kwargs_list,
         method=self.method,
         config=self.config,
         session=MockRequests
     )
     self.check_results(scc, 3)
     self.check_results(err, 1)
Ejemplo n.º 6
0
 def test_send_mass(self):
     args_list = self.get_args_list(["test", "test2", "404"])
     kwargs_list = self.get_kwargs_list(["test", "test2", "404"])
     start = datetime.now()
     scc, err = send_mass(args_list,
                          kwargs_list,
                          method=self.method,
                          config=self.config,
                          session=MockRequests)
     end = datetime.now()
     duration = (end - start).total_seconds()
     self.assertLess(duration, 0.1)
     self.check_results(scc, 2)
     self.check_results(err, 1)
Ejemplo n.º 7
0
 def test_send_mass_intervals(self):
     self.config.interval_duration = 250  # 0.25 secs
     args_list = self.get_args_list(["test", "test2"])
     kwargs_list = self.get_kwargs_list(["test", "test2"])
     start = datetime.now()
     scc, err = send_mass(args_list,
                          kwargs_list,
                          method=self.method,
                          config=self.config,
                          session=MockRequests)
     end = datetime.now()
     duration = (end - start).total_seconds()
     self.assertGreater(duration, 0.5)
     self.assertLess(duration, 1)
     self.check_results(scc, 2)
     self.check_results(err, 0)
Ejemplo n.º 8
0
 def test_send_mass_concat_arguments(self, send_serie):
     self.config.concat_args_size = 3
     self.config.concat_args_symbol = "|"
     scc, err = send_mass(
         [[1], [2], [3], [4], [5, 5], [6], [7]],
         [{}, {}, {}, {}, {}, {}, {}],
         method=self.method,
         config=self.config,
         session=MockRequests
     )
     send_serie.assert_called_with(
         [["1|2|3"], ["4|5|5|6"], ["7"]], [{}, {}, {}],
         method=self.method,
         config=self.config,
         session=MockRequests
     )