def test_setSDRROOT(self):
# None type
self.assertRaises(TypeError, sb.setSDRROOT, None)
# Bad dir should not change root
sdrroot = sb.getSDRROOT()
self.assertRaises(AssertionError, sb.setSDRROOT, 'TEMP_PATH')
self.assertEquals(sdrroot, sb.getSDRROOT())
# Good dir with no dev/dom should not change root
self.assertRaises(AssertionError, sb.setSDRROOT, 'jackhammer')
self.assertEquals(sdrroot, sb.getSDRROOT())
# New root
sb.setSDRROOT('sdr')
self.assertEquals(sb.getSDRROOT(), 'sdr')
# Restore sdrroot
sb.setSDRROOT(os.environ['SDRROOT'])
评论列表
文章目录