Beispiel #1
0
 def test_boost_version_too_old(self):
     data = '#define BOOST_LIB_VERSION "1_23_4"\n'
     with mock.patch(mock_open_name, mock_open(read_data=data)):
         hdr = HeaderDirectory(abspath('path'))
         with self.assertRaises(PackageVersionError):
             packages._boost_version(hdr, SpecifierSet('>=1.30'))
Beispiel #2
0
 def test_boost_version_cant_parse(self):
     data = 'foobar\n'
     with mock.patch(mock_open_name, mock_open(read_data=data)):
         hdr = HeaderDirectory(abspath('path'))
         with self.assertRaises(PackageVersionError):
             packages._boost_version(hdr, SpecifierSet(''))
Beispiel #3
0
 def test_boost_version(self):
     data = '#define BOOST_LIB_VERSION "1_23_4"\n'
     with mock.patch(mock_open_name, mock_open(read_data=data)):
         hdr = HeaderDirectory(abspath('path'))
         self.assertEqual(packages._boost_version(hdr, SpecifierSet('')),
                          Version('1.23.4'))