It is not possible to create a public key from a private key.
I ran into a problem while writing a test. In test_tools there is no functionality to convert a private key to a public one.
To provide a public key, I have to generate it separately with the same parameters (account_name and secret) tt.PublicKey('alice', secret='new_key')
new_key = str(tt.PrivateKey('alice', secret='new_key'))
wallet.api.import_key(new_key)
alice_new_authority = {"weight_threshold": 1, "account_auths": [], "key_auths": [[str(tt.PublicKey('alice', secret='new_key')), 1]]}
A method to get the public key from the generated private key would be helpful:
PrivateKey('alice', secret='new').get_public_key()
Edited by Michał Kudela