def test_valid_module(self): try: module = juce.Module(os.path.join(modules_dir, 'test_valid_module')) except IOError: self.fail('Unexpected IOError while loading a valid module') except ValueError: self.fail('Unexpected ValueError while loading a valid module') except: self.fail('Unexpected error while loading a valid module') else: self.assertTrue(module.ID == 'test_valid_module') self.assertTrue(module.vendor == 'vendor') self.assertTrue(module.version == '1.0.0') self.assertTrue(module.name == 'name') self.assertTrue(module.description == 'description') try: module.version = '1.2.3' except: self.fail('Unexpected error setting the version number') else: self.assertTrue(module.version == '1.2.3') module.version = '1.0.0'
def test_missing_version(self): with self.assertRaises(ValueError): juce.Module(os.path.join(modules_dir, 'test_missing_version'))
def test_invalid_vendor(self): with self.assertRaises(ValueError): juce.Module(os.path.join(modules_dir, 'test_invalid_vendor'))
def test_missing_module(self): with self.assertRaises(IOError): juce.Module(os.path.join(modules_dir, 'test_missing_module'))
import sys import argparse # required to pull in the juce module sys.path.append( os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) import juce parser = argparse.ArgumentParser() parser.add_argument('--path', required=True, help='path to a directory containing a valid JUCE module.') args = parser.parse_args() module = juce.Module(args.path) print('') print('=' * 80) print('path: ' + module.path) print('id: ' + module.id) print('vendor: ' + module.vendor) print('version: ' + module.version) print('name: ' + module.name) print('description: ' + module.description) print('dependencies: ' + ', '.join(module.dependencies)) print('website: ' + module.website) print('license: ' + module.license) print('searchpaths: ' + ', '.join(module.searchpaths)) print('OSXFrameworks: ' + ', '.join(module.OSXFrameworks)) print('iOSFrameworks: ' + ', '.join(module.iOSFrameworks))