def test_local_version_exception(self): """ Package.local_version() exception test """ Config.params['cfg'] = 'wrong.cfg' with self.assertRaises(PackageError) as context: Package.local_version() self.assertTrue(PackageError == context.expected)
def test_update_exception(self): """ Package.update() exception test """ Config.params['cvsupdate'] = 'wrongcvs' with self.assertRaises(PackageError) as context: Package.update() self.assertTrue(PackageError == context.expected) Config.params['cvsupdate'] = '/usr/bin/git pull origin master'
def test_local_version(self): """ Package.local_version() test """ Config.params['cfg'] = 'setup.cfg' actual = FileSystem.readcfg('setup.cfg').get('info', 'version') expected = Package.local_version() self.assertEqual(actual, expected)
def test_version(self): """ Package.version() test """ Config.params['cfg'] = 'setup.cfg' expected = Package.version() self.assertIsNotNone(expected) self.assertIs(type(expected), str)
def test_update_windows(self): """ Package.update() test """ Config.params['cfg'] = 'setup.cfg' Config.params['update'] = '{status}' setattr(sys, 'is_windows', True) expected = Package.update() self.assertIsNotNone(expected)
def test_update_unix(self): """ Package.update() unix test """ Config.params['cfg'] = 'setup.cfg' Config.params['update'] = '{status}' expected = Package.update() self.assertIsNotNone(expected) self.assertIs(type(expected), str)
def test_examples(self): """ Package.examples() test """ expected = Package.examples() self.assertIsNotNone(expected) self.assertIs(type(expected), str)
def test_check_interpreter(self): """ Package.check_interpreter() test """ expected = Package.check_interpreter() self.assertTrue(expected)
def test_update_exception(self): """ Package.update() exception test """ with self.assertRaises(PackageError) as context: Package.update() self.assertTrue(PackageError == context.expected)