Example #1
0
    def test_get_account_count(self):
        lcc.set_step("Get account count")
        self.send_request(self.get_request(self.__get_account_count),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check get account count")
        check_that("'account count'", self.__resp["result"], is_integer(29))
Example #2
0
    def test_get_witness_count(self):
        lcc.set_step("Get witness count")
        self.send_request(self.get_request(self.__get_witness_count),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check get witness count")
        check_that("'witness count'", self.__resp["result"], is_integer(1))
Example #3
0
    def test(self, project_dir):
        # image from https://pixabay.com/en/cake-lemon-sweet-yellow-food-2700645/
        image_path = osp.join(project_dir, "cake.jpg")

        lcc.set_step("Attachment")
        lcc.save_attachment_file(image_path)

        lcc.set_step("Image attachment")
        lcc.save_image_file(image_path)
Example #4
0
 def setup_suite(self):
     # Check status of connection
     lcc.set_step("Open connection")
     if self.__ws is not None:
         lcc.log_url(ECHO_DEV)
         lcc.log_info("Connection successfully created")
         self.__login_echo()
     else:
         lcc.log_error("Connection not established")
Example #5
0
	def some_test(self, omdb):
		data = omdb.get_movie_info("matrix", 1999)
		lcc.set_step("Check movie information")
		check_that_in(
			data,
			"Title", "The Matrix",
			"Actors", contains_string("Keanu Reeves"),
			"Director", re.compile(".+Wachow?ski", re.I),
			"imdbRating", is_float(8.5)
		)
Example #6
0
    def test_get_all_asset_holders(self):
        lcc.set_step("Get all asset holders")
        self.get_holders()

        lcc.set_step("Check asset_id and count of all asset holders")
        check_that(
            "'contract result'",
            self.resp_all_asset_holders["result"],
            is_(self.get_expected(self.__get_all_asset_holders)),
        )
Example #7
0
    def test_piggy_smart_contract_step6(self):
        lcc.set_step("Get contract balance. Amount should be reduced by one.")
        params = ["1.16.80"]
        self.send_request(self.get_request(self.__get_contract_balances, params), self.__id_db)
        self.__resp = self.get_response()

        lcc.set_step("Get owner balance. Amount should be increase by one")
        params = [["1.2.16"], False]
        self.send_request(self.get_request(self.__get_full_accounts, params), self.__id_db)
        self.__resp = self.get_response()
Example #8
0
    def test_piggy_smart_contract_step8(self):
        lcc.set_step("Get contract balance, must be 0 (zero)")
        params = ["1.16.80"]
        self.send_request(self.get_request(self.__get_contract_balances, params), self.__id_db)
        self.__resp = self.get_response()

        lcc.set_step("Get that contract to be 'suicided=True'")
        params = [["1.16.80"]]
        self.send_request(self.get_request(self.__get_objects, params), self.__id_db)
        self.__resp = self.get_response()
Example #9
0
    def test_get_relative_account_history(self):
        lcc.set_step("Get relative account history")
        self.send_request(self.get_request(self.__get_relative_account_history), self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check get relative account history")
        check_that(
            "'relative account history'",
            self.__resp["result"],
            is_list(self.get_expected(self.__get_relative_account_history)),
        )
Example #10
0
    def test_get_contract_history(self):
        lcc.set_step("Get contract history")
        self.send_request(self.get_request(self.__get_contract_history), self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check get contract history")
        check_that(
            "'contract history'",
            self.__resp["result"],
            is_(self.get_expected(self.__get_contract_history)),
        )
Example #11
0
    def test_get_account_history_operations(self):
        lcc.set_step("Get account history operations")
        self.send_request(self.get_request(self.__get_account_history_operations), self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check get account history operations")
        check_that(
            "'account history operations'",
            self.__resp["result"],
            is_(self.get_expected(self.__get_account_history_operations)),
        )
Example #12
0
    def test_get_transaction(self):
        lcc.set_step("Retrieve transaction")
        self.send_request(self.get_request(self.__get_transaction),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check transaction info")
        check_that(
            "'transaction info'",
            self.__resp["result"],
            is_dict(self.get_expected(self.__get_transaction)),
        )
Example #13
0
    def test_get_global_properties(self):
        lcc.set_step("Get global properties")
        self.send_request(self.get_request(self.__get_global_properties),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check global properties info")
        check_that(
            "'global properties'",
            self.__resp["result"],
            is_dict(self.get_expected(self.__get_global_properties)),
        )
Example #14
0
    def test_get_config(self):
        lcc.set_step("Get config")
        self.send_request(self.get_request(self.__get_config),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check config info")
        check_that(
            "'config'",
            self.__resp["result"],
            is_dict(self.get_expected(self.__get_config)),
        )
Example #15
0
    def test_get_chain_id(self):
        lcc.set_step("Get chain id")
        self.send_request(self.get_request(self.__get_chain_id),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check chain id info")
        check_that(
            "'chain id'",
            self.__resp["result"],
            is_str(self.get_expected(self.__get_chain_id)),
        )
Example #16
0
    def test_get_key_references(self):
        lcc.set_step("Get key references")
        self.send_request(self.get_request(self.__get_key_references),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check key references")
        check_that(
            "'key references'",
            self.__resp["result"],
            is_list(self.get_expected(self.__get_key_references)),
        )
Example #17
0
    def test_get_all_contracts(self):
        lcc.set_step("Get all contracts")
        self.send_request(self.get_request(self.__get_all_contracts),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check get all contracts")
        check_that(
            "'all contracts'",
            self.__resp["result"],
            is_(self.get_expected(self.__get_all_contracts)),
        )
Example #18
0
    def test_get_settle_orders(self):
        lcc.set_step("Get settle orders")
        self.send_request(self.get_request(self.__get_settle_orders),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check get settle orders")
        check_that(
            "'settle orders'",
            self.__resp["result"],
            is_(self.get_expected(self.__get_settle_orders)),
        )
Example #19
0
    def test_set_subscribe_callback(self):
        lcc.set_step("Set subscribe callback")
        self.send_request(self.get_request(self.__set_subscribe_callback),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check set subscribe callback")
        check_that(
            "'subscribe callback'",
            self.__resp["result"],
            is_none(),
        )
Example #20
0
    def test_get_objects(self):
        lcc.set_step("Get objects 'account' and 'asset'")
        self.send_request(self.get_request(self.__get_objects),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check get objects 'account' and 'asset'")
        check_that(
            "'account' and 'asset'",
            self.__resp["result"],
            is_list(self.get_expected(self.__get_objects)),
        )
Example #21
0
    def test_lookup_vote_ids(self):
        lcc.set_step("Lookup vote ids")
        self.send_request(self.get_request(self.__lookup_vote_ids),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check lookup vote ids")
        check_that(
            "'lookup vote ids'",
            self.__resp["result"],
            is_list(self.get_expected(self.__lookup_vote_ids)),
        )
Example #22
0
    def test_cancel_all_subscriptions(self):
        lcc.set_step("Cancel all subscriptions")
        self.send_request(self.get_request(self.__cancel_all_subscriptions),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Cancel all subscriptions")
        check_that(
            "'cancel all subscriptions'",
            self.__resp["result"],
            is_none(),
        )
Example #23
0
    def test_get_account_by_name(self):
        lcc.set_step("Get account by name")
        self.send_request(self.get_request(self.__get_account_by_name),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check account by name")
        check_that(
            "'init2'",
            self.__resp["result"],
            is_dict(self.get_expected(self.__get_account_by_name)),
        )
Example #24
0
    def test_get_margin_positions(self):
        lcc.set_step("Get margin positions")
        self.send_request(self.get_request(self.__get_margin_positions),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check get margin positions")
        check_that(
            "'margin positions'",
            self.__resp["result"],
            is_(self.get_expected(self.__get_margin_positions)),
        )
Example #25
0
    def test_get_block_header(self):
        lcc.set_step("Retrieve header of signed block")
        self.send_request(self.get_request(self.__get_block_header),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check block header info")
        check_that(
            "'block header info'",
            self.__resp["result"],
            is_dict(self.get_expected(self.__get_block_header)),
        )
Example #26
0
    def test_get_proposed_transactions(self):
        lcc.set_step("Get proposed transactions")
        self.send_request(self.get_request(self.__get_proposed_transactions, ),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check get proposed transactions")
        check_that(
            "'proposed transactions'",
            self.__resp["result"],
            is_(self.get_expected(self.__get_proposed_transactions)),
        )
Example #27
0
    def test_get_committee_members(self):
        lcc.set_step("Get committee members")
        self.send_request(self.get_request(self.__get_committee_members),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check get committee members")
        check_that(
            "'committee members'",
            self.__resp["result"],
            is_list(self.get_expected(self.__get_committee_members)),
        )
Example #28
0
    def test_lookup_account_names(self):
        lcc.set_step("Lookup account names")
        self.send_request(self.get_request(self.__lookup_account_names),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check lookup account names")
        check_that(
            "'lookup account names'",
            self.__resp["result"],
            is_list(self.get_expected(self.__lookup_account_names)),
        )
Example #29
0
    def test_get_workers_by_account(self):
        lcc.set_step("Get workers by account")
        self.send_request(self.get_request(self.__get_workers_by_account),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check get workers by account")
        check_that(
            "'workers by account'",
            self.__resp["result"],
            is_(self.get_expected(self.__get_workers_by_account)),
        )
Example #30
0
    def test_set_block_applied_callback(self):
        lcc.set_step("Set block applied callback")
        self.send_request(self.get_request(self.__set_block_applied_callback),
                          self.__identifier)
        self.__resp = self.get_response()

        lcc.set_step("Check set block applied callback")
        check_that(
            "'block applied callback'",
            self.__resp["result"],
            is_none(),
        )