def test_render(self): self.fs.CreateFile('needs.json', contents=textwrap.dedent('''\ libraries: mylib: {% set bar = 'bar' -%} directory: {{bar}} ''')) needy = Needy(needy_configuration=NeedyConfiguration(None)) self.assertEqual(needy.render().strip(), textwrap.dedent('''\ libraries: mylib: directory: bar ''').strip())
def test_libraries_to_build(self): self.fs.CreateFile('needs.json', contents=json.dumps({ 'libraries': { 'excluded': {}, 'dependant': { 'dependencies': 'dependency' }, 'dependency': {} } })) needy = Needy(needy_configuration=NeedyConfiguration(None)) libraries = needy.libraries_to_build(needy.target('host'), ['dependant']) self.assertEqual(len(libraries), 2) self.assertEqual(libraries[0][0], 'dependency') self.assertEqual(libraries[1][0], 'dependant')
def test_find_needs_file_with_multiple(self): self.fs.CreateFile('needs.json') self.fs.CreateFile('needs.yaml') with self.assertRaises(RuntimeError): Needy.find_needs_file('.')
def source_directory(self, library, target=Target(host_platform()())): needy = Needy(self.path()) return needy.source_directory(library)
def test_find_needs_file_with_yaml_only(self): self.fs.CreateFile('needs.yaml') self.assertEqual(Needy.find_needs_file('.'), os.path.sep + 'needs.yaml')
def needs_directory(self): needy = Needy(self.path()) return needy.needs_directory()
def build_directory(self, library, target_or_universal_binary=Target(host_platform()())): needy = Needy(self.path()) return needy.build_directory(library, target_or_universal_binary)
def pkg_config_path(self): needy = Needy(self.path()) return needy.pkg_config_path(Target(host_platform()()))