def test_slapos_cfg_detection_when_file_does_not_exists(self): """ If given configuration file does not exists then False is return """ slapos_cfg = os.path.join(self._tempdir, 'slapos.cfg') sys.argv = ['entry', slapos_cfg] self.assertFalse(entry.checkSlaposCfg())
def test_slapos_cfg_detection_when_correct(self): """ If given configuration file have slapos section then True is return """ slapos_cfg = os.path.join(self._tempdir, 'slapos.cfg') open(slapos_cfg, 'w').write('[slapos]') sys.argv.append(slapos_cfg) self.assertTrue(entry.checkSlaposCfg())
def test_slapos_cfg_detection_when_no_slapos_section(self): """ If given configuration file does not have slapos section then False is return """ slapos_cfg = os.path.join(self._tempdir, 'slapos.cfg') open(slapos_cfg, 'w').write('[slapformat]') sys.argv = ['entry', slapos_cfg] self.assertFalse(entry.checkSlaposCfg())
def test_slapos_cfg_detection_when_no_configuration_given(self): """ If no configuration file is given then False is return """ sys.argv = ['entry', '--logfile', '/log/file'] self.assertFalse(entry.checkSlaposCfg())