Ejemplo n.º 1
0
 def test_binary_unicode_error(self):
     client = BlazeMeterClient(logging.getLogger(''))
     client.address = u"http://127.0.0.1:58000"
     client.session_id = "ffff"
     self.token = "faketoken"
     with open(__dir__() + "/../data/jmeter-dist-2.13.zip", 'rb') as fds:
         zip_content = fds.read()
     # actually, we're testing that UnicodeDecodeError is not raised
     self.assertRaises(URLError, client.upload_file, "jtls_and_more.zip", zip_content)
Ejemplo n.º 2
0
 def test_binary_unicode_error(self):
     client = BlazeMeterClient(logging.getLogger(''))
     client.address = u"http://127.0.0.1:58000"
     client.session_id = "ffff"
     self.token = "faketoken"
     with open(__dir__() + "/../data/jmeter-dist-2.13.zip", 'rb') as fds:
         zip_content = fds.read()
     # actually, we're testing that UnicodeDecodeError is not raised
     self.assertRaises(URLError, client.upload_file, "jtls_and_more.zip", zip_content)
Ejemplo n.º 3
0
    def test_unicode_request(self):
        """
        test UnicodeDecodeError in BlazeMeterClient._request()
        """

        blazemeter_client = BlazeMeterClient(logging.getLogger(''))
        blazemeter_client.address = "http://127.0.0.1:58000"
        blazemeter_client.active_session_id = "ffff"
        self.token = "faketoken"
        normal_urlopen = bzt.modules.blazemeter.urlopen
        bzt.modules.blazemeter.urlopen = dummy_urlopen
        blazemeter_client.upload_file("tests/data/unicode_file")
        bzt.modules.blazemeter.urlopen = normal_urlopen
Ejemplo n.º 4
0
    def test_unicode_request(self):
        """
        test UnicodeDecodeError in BlazeMeterClient._request()
        """

        blazemeter_client = BlazeMeterClient(logging.getLogger(''))
        blazemeter_client.address = "http://127.0.0.1:58000"
        blazemeter_client.session_id = "ffff"
        self.token = "faketoken"
        normal_urlopen = bzt.modules.blazemeter.urlopen
        bzt.modules.blazemeter.urlopen = dummy_urlopen
        blazemeter_client.upload_file(__dir__() + "/../data/unicode_file")
        bzt.modules.blazemeter.urlopen = normal_urlopen
Ejemplo n.º 5
0
 def test_ping(self):
     obj = BlazeMeterClient(logging.getLogger(''))
     obj.address = "https://a.blazemeter.com"
     obj.ping()
Ejemplo n.º 6
0
 def test_ping(self):
     obj = BlazeMeterClient(logging.getLogger(''))
     obj.address = "https://a.blazemeter.com"
     obj.ping()