def test_publish(self): cm = CardManager(self.__context) identity = IdentitiesManager().create_user("alice", "username") owner_key = VirgilKey(self.__context, self.__key_pair_alice.private_key) card = cm.create(identity, owner_key) try: card.publish() self.assertIsInstance(cm.get(card.id), VirgilCard) self.assertEqual(cm.get(card.id).identity, card.identity) finally: try: self.__cleanup_cards(card) except Exception: pass
def test_import_card_published_global(self): data = self.__compatibility_data["export_published_global_virgil_card"] cm = CardManager(self.__context) imported_card = cm.import_card(data["exported_card"]) self.assertEqual(imported_card, cm.get(data["card_id"]))