Esempio n. 1
0
class TestSwiftLMDetect(unittest.TestCase):
    def setUp(self):
        self.testdir = tempfile.mkdtemp()
        self.detect = SwiftLMDetect(self.testdir)

    def tearDown(self):
        rmtree(self.testdir, ignore_errors=True)

    def _test_detect(self, service):
        self.detect.SWIFTLM_DIR = self.testdir
        conf_file = service + '.conf'
        conf_path = os.path.join(self.testdir, conf_file)
        with open(conf_path, 'wb'):
            self.detect._detect()
        self.assertTrue(self.detect.available)

    def test_detect_server(self):
        self._test_detect('swiftlm-scan')

    def test_detect_none(self):
        self.detect.SWIFT_DIR = self.testdir
        self.detect._detect()
        self.assertFalse(self.detect.available)
Esempio n. 2
0
class TestSwiftLMDetect(unittest.TestCase):
    def setUp(self):
        self.testdir = tempfile.mkdtemp()
        self.detect = SwiftLMDetect(self.testdir)

    def tearDown(self):
        rmtree(self.testdir, ignore_errors=True)

    def _test_detect(self, service):
        self.detect.SWIFTLM_DIR = self.testdir
        conf_file = service + '.conf'
        conf_path = os.path.join(self.testdir, conf_file)
        with open(conf_path, 'wb'):
            self.detect._detect()
        self.assertTrue(self.detect.available)

    def test_detect_server(self):
        self._test_detect('swiftlm-scan')

    def test_detect_none(self):
        self.detect.SWIFT_DIR = self.testdir
        self.detect._detect()
        self.assertFalse(self.detect.available)
Esempio n. 3
0
 def setUp(self):
     self.testdir = tempfile.mkdtemp()
     self.detect = SwiftLMDetect(self.testdir)
Esempio n. 4
0
 def setUp(self):
     self.testdir = tempfile.mkdtemp()
     self.detect = SwiftLMDetect(self.testdir)