def test_read_ninja_bad_file_plugin(self): path = self.tmpdir frula_file = os.path.join(path, 'frula.plugin') with open(frula_file, 'w') as fp: fp.write('frula\n') structure = read_ninja_plugin(path) assert structure == dict()
def test_read_ninja_plugin(self): path = self.tmpdir content = dict(samurai='ki') plugin_file = os.path.join(path, 'samurai.plugin') with open(plugin_file, 'w') as fp: json.dump(content, fp) structure = read_ninja_plugin(path) assert structure['samurai'] == 'ki'
def create_zip(self): folder = self.explorer_s.get_tree_projects()._get_project_root().path plugin = json_manager.read_ninja_plugin(folder) module = os.path.join(folder, plugin.get('module', 'module') + '.zip') self.create_zip_file(self.dir_entries(folder, True), module, folder)