コード例 #1
0
 def test_invalid_get_tx_info_1(self):
     self.assertIsInstance(xbridge_client.CHECK_GET_TX_INFO(" "), list)
     self.assertIsInstance(xbridge_client.CHECK_GET_TX_INFO(""), list)
     self.assertIsInstance(xbridge_client.CHECK_GET_TX_INFO("[]"), list)
     self.assertIsInstance(xbridge_client.CHECK_GET_TX_INFO("{}"), list)
     self.assertIsInstance(xbridge_client.CHECK_GET_TX_INFO("''"), list)
     self.assertIsInstance(xbridge_client.CHECK_GET_TX_INFO("'"), list)
コード例 #2
0
def test_get_tx_info_load_v3(nb_of_runs):
    time_distribution = []
    total_elapsed_seconds = 0
    for i in range(1, nb_of_runs):
        garbage_input_str = xbridge_utils.generate_garbage_input(64)
        ts = time.time()
        assert type(
            xbridge_client.CHECK_GET_TX_INFO(garbage_input_str)) == list
        te = time.time()
        total_elapsed_seconds += te - ts
        json_str = {
            "time": te - ts,
            "char_nb": len(garbage_input_str),
            "API": "dxGetTxInfo"
        }
        time_distribution.append(json_str)
    xbridge_utils.export_data("test_get_tx_info_load_v3.xlsx",
                              time_distribution)
コード例 #3
0
 def invalid_get_tx_info_test_5(self):
     # We pick from a single class at a time
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\a]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\p]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\d]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\W]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\w]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\h]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\s]{1:11000}').render()), dict)
     # We pick from combinations of 2 classes
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\p\d]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\p\a]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\p\h]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\s\d]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\s\a]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\s\h]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\s\p]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\W\d]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\W\a]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\W\h]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\W\p]{1:11000}').render()), dict)
     # We pick from combinations of 3 classes
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\a\d\W]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\a\d\h]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\a\d\s]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\a\d\p]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\a\d\W]{1:11000}').render()), dict)
     # We pick from combinations of 4 classes
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\p\d\w\s]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\p\d\a\h]{1:11000}').render()), dict)
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\p\d\a\s]{1:11000}').render()), dict)
     # We pick from combinations of 5 classes
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             StringGenerator('[\p\d\W\w\h\a]{1:11000}').render()), dict)
コード例 #4
0
 def test_invalid_get_tx_info_2(self):
     self.assertIsInstance(
         xbridge_client.CHECK_GET_TX_INFO(
             self.random_length_str_with_random_char_class), list)