def run(self): """ Execute a set of operations to perform the Task. """ write_config(self.filename) print('Wrote default config to', self.filename)
def test_write_config_dir(self): os.mkdir(self.conf_file) with pytest.raises(PakitError): write_config(self.conf_file)
def test_write_config_perms(self): with pytest.raises(PakitError): write_config("/ttt.yml")
def test_write_config(self): assert not os.path.exists(self.conf_file) write_config(self.conf_file) assert os.path.exists(self.conf_file)