def test_multiple_vimba_home_directories(self):
     # If multiple VIMBA_HOME directories are found an error should be raised
     candidates = [
         '/some/random/path',
         '/opt/some/gentl/provider',
         '/opt/Vimba_4_0',  # first installation
         '/home/username/Vimba_4_0',  # second installation
         '/opt/another/gentl/provider',
         '/another/incorrect/path'
     ]
     with self.assertRaises(VimbaSystemError):
         _select_vimba_home(candidates)
 def test_many_vimba_home_candidates(self):
     candidates = [
         '/some/random/path',
         '/opt/some/gentl/provider',
         '/opt/Vimba_4_0',  # This should be selected
         '/opt/another/gentl/provider',
         '/another/incorrect/path'
     ]
     expected = '/opt/Vimba_4_0'
     self.assertEqual(expected, _select_vimba_home(candidates))
 def test_unsorted_vimba_home_candidates(self):
     candidates = [
         '/opt/some/other/gentl/provider', '/home/username/Vimba_4_0'
     ]
     expected = '/home/username/Vimba_4_0'
     self.assertEqual(expected, _select_vimba_home(candidates))
 def test_single_good_vimba_home_candidate(self):
     candidates = ['/opt/Vimba_3_1']
     expected = '/opt/Vimba_3_1'
     self.assertEquals(expected, _select_vimba_home(candidates))
 def test_single_bad_vimba_home_candidate(self):
     candidates = ['/some/path']
     with self.assertRaises(VimbaSystemError):
         _select_vimba_home(candidates)
 def test_empty_string(self):
     candidates = ['']
     with self.assertRaises(VimbaSystemError):
         _select_vimba_home(candidates)
 def test_empty_gentl_path(self):
     candidates = []
     with self.assertRaises(VimbaSystemError):
         _select_vimba_home(candidates)