Esempio n. 1
0
 def test_no_usage(self):
     with self.assertRaises(TypeError):
         make_usage('pkg',
                    None,
                    submodules=None,
                    _options=self.make_options(),
                    _path_bases=self.path_bases)
Esempio n. 2
0
 def test_invalid_values(self):
     with self.assertRaises(FieldError):
         make_usage('pkg', {
             'type': 'pkg_config',
             'path': '..'
         },
                    submodules=None,
                    _options=self.make_options(),
                    _path_bases=self.path_bases)
Esempio n. 3
0
 def test_invalid_keys(self):
     with self.assertRaises(TypeError):
         make_usage('pkg', {
             'type': 'pkg_config',
             'unknown': 'blah'
         },
                    submodules=None,
                    _options=self.make_options(),
                    _path_bases=self.path_bases)
Esempio n. 4
0
 def test_make_string(self):
     usage = make_usage('pkg',
                        'pkg_config',
                        submodules=None,
                        _options=self.make_options(),
                        _path_bases=self.path_bases)
     self.assertIsInstance(usage, PkgConfigUsage)
     self.assertEqual(usage.path, Path('builddir', 'pkgconfig'))
Esempio n. 5
0
 def test_unknown_usage(self):
     with self.assertRaises(FieldError):
         make_usage('pkg', {'type': 'goofy'},
                    submodules=None,
                    _options=self.make_options(),
                    _path_bases=self.path_bases)