def setup_func(): global test_data_dir config = TConfig() updater = PyiUpdater(config) ph = PackageHandler(updater) kh = KeyHandler(updater) kh.test = True ph.setup() kh.make_keys()
def test_setup(): global test_data_dir config = TConfig() updater = PyiUpdater(config) ph = PackageHandler(updater) key_dir = os.path.join(ph.data_dir, u'keys') kh = KeyHandler(updater) kh.test = True assert os.path.exists(os.path.abspath(key_dir)) assert kh.private_key_name == u'jms.pem' assert kh.public_key_name == u'jms.pub'
def test_execution(): global test_data_dir config = TConfig() updater = PyiUpdater(config) ph = PackageHandler(updater) kh = KeyHandler(updater) ph.setup() kh.test = True kh.make_keys() # Make zipfile with ChDir(test_data_dir): os.mkdir(u'test-app') with ChDir(u'test-app'): with open(u'app.txt', u'w') as f: f.write(u'I am so happy' * 1000) shutil.make_archive(u'Test App-mac-0.2.0', u'zip', u'test-app') shutil.move(u'Test App-mac-0.2.0.zip', u'new') ph.process_packages() kh.sign_update()
import sys from jms_utils.paths import ChDir sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from pyi_updater import PyiUpdater from pyi_updater.key_handler import KeyHandler from pyi_updater.package_handler import PackageHandler from pyi_updater.utils import remove_dot_files from tconfig import TConfig pyi_updater = PyiUpdater(TConfig()) kh = KeyHandler(pyi_updater) kh.test = True kh._add_filecrypt() ph = PackageHandler(pyi_updater) PYI_DATA = os.path.abspath(os.path.join(u'tests', u'pyi-data')) def setup_func(): ph.setup() kh.make_keys() test_data_dir = os.path.abspath(os.path.join(u'tests', u'test data', u'5.0')) with ChDir(test_data_dir): files = remove_dot_files(os.listdir(os.getcwd())) for f in files: shutil.copy(f, ph.new_dir)
import sys from jms_utils.paths import ChDir sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from pyi_updater import PyiUpdater from pyi_updater.key_handler import KeyHandler from pyi_updater.package_handler import PackageHandler from pyi_updater.utils import remove_dot_files from tconfig import TConfig pyi_updater = PyiUpdater(TConfig()) kh = KeyHandler(pyi_updater) kh.test = True kh._add_filecrypt() ph = PackageHandler(pyi_updater) PYI_DATA = os.path.abspath(os.path.join(u'tests', u'pyi-data')) def setup_func(): ph.setup() kh.make_keys() test_data_dir = os.path.abspath( os.path.join(u'tests', u'test data', u'5.0')) with ChDir(test_data_dir): files = remove_dot_files(os.listdir(os.getcwd())) for f in files: shutil.copy(f, ph.new_dir)