пофиксил комманды создания/удаления/восстановления бэкапа

This commit is contained in:
rzaitov
2013-11-11 20:08:51 +04:00
parent aba01994b3
commit 56fe80c45b
22 changed files with 212 additions and 110 deletions
@@ -0,0 +1 @@
__author__ = 'rzaitov'
@@ -0,0 +1,25 @@
import unittest
from parsers.ParserBackup.CreateBackupParser import CreateBackupParser
class TestCreateBackup(unittest.TestCase):
def setUp(self):
self.parser = CreateBackupParser()
def test_parseCurrentDir(self):
line = "create backup for '.'"
backupArg = self.parser.parseLine(line)
self.assertEqual('.', backupArg.folderPath)
def test_parseRelativePath(self):
line = "create backup for '../Some/Path'"
backupArg = self.parser.parseLine(line)
self.assertEqual('../Some/Path', backupArg.folderPath)
def test_parseAbsPath(self):
line = "create backup for '/Some/Abs/Path'"
backupArg = self.parser.parseLine(line)
self.assertEqual('/Some/Abs/Path', backupArg.folderPath)
@@ -0,0 +1,25 @@
import unittest
from parsers.ParserBackup.DeleteBackupParser import DeleteBackupParser
class TestDeleteBackup(unittest.TestCase):
def setUp(self):
self.parser = DeleteBackupParser()
def test_parseCurrentDir(self):
line = "delete backup '.'"
backupArg = self.parser.parseLine(line)
self.assertEqual('.', backupArg.folderPath)
def test_parseRelativePath(self):
line = "delete backup '../Some/Path'"
backupArg = self.parser.parseLine(line)
self.assertEqual('../Some/Path', backupArg.folderPath)
def test_parseAbsPath(self):
line = "delete backup '/Some/Abs/Path'"
backupArg = self.parser.parseLine(line)
self.assertEqual('/Some/Abs/Path', backupArg.folderPath)
@@ -0,0 +1,25 @@
import unittest
from parsers.ParserBackup.RestoreBackupParser import RestoreBackupParser
class TestRestoreBackup(unittest.TestCase):
def setUp(self):
self.parser = RestoreBackupParser()
def test_parseCurrentDir(self):
line = "restore from backup '.'"
backupArg = self.parser.parseLine(line)
self.assertEqual('.', backupArg.folderPath)
def test_parseRelativePath(self):
line = "restore from backup '../Some/Path'"
backupArg = self.parser.parseLine(line)
self.assertEqual('../Some/Path', backupArg.folderPath)
def test_parseAbsPath(self):
line = "restore from backup '/Some/Abs/Path'"
backupArg = self.parser.parseLine(line)
self.assertEqual('/Some/Abs/Path', backupArg.folderPath)