Пример #1
0
 def test_parse_module_at_version(self):
     self.assertEqual(
         install.parse_module_at_version('[email protected]'),
         install.Installable('googlemock', '1.7.0'))
     self.assertEqual(
         install.parse_module_at_version('googlemock'),
         install.Installable('googlemock', None))
Пример #2
0
    def test_parse_existing_module_at_version(self):
        library = brulib.library.Library('./library')

        self.assertEqual(
            install.parse_existing_module_at_version('[email protected]', library),
            install.Installable('googlemock', '1.7.0'))
        self.assertEqual(
            install.parse_existing_module_at_version('googlemock', library),
            install.Installable('googlemock', '1.7.0'))
        # that's assuming the latest version of googlemock in ./library
        # is still 1.7.0
        
        self.assertRaises(Exception, 
            lambda: install.parse_module_at_version('nonexistingmodule', library))
        self.assertRaises(Exception, 
            lambda: install.parse_module_at_version('[email protected]', library))
Пример #3
0
    def test_parse_existing_module_at_version(self):
        library = brulib.library.Library('./library')

        self.assertEqual(
            install.parse_existing_module_at_version('[email protected]',
                                                     library),
            install.Installable('googlemock', '1.7.0'))
        self.assertEqual(
            install.parse_existing_module_at_version('googlemock', library),
            install.Installable('googlemock', '1.7.0'))
        # that's assuming the latest version of googlemock in ./library
        # is still 1.7.0

        self.assertRaises(
            Exception, lambda: install.parse_module_at_version(
                'nonexistingmodule', library))
        self.assertRaises(
            Exception,
            lambda: install.parse_module_at_version('[email protected]', library))
Пример #4
0
 def test_parse_module_at_version(self):
     self.assertEqual(install.parse_module_at_version('[email protected]'),
                      install.Installable('googlemock', '1.7.0'))
     self.assertEqual(install.parse_module_at_version('googlemock'),
                      install.Installable('googlemock', None))