add unit test last case
This commit is contained in:
parent
e2ad6b75d2
commit
9d3cb60f41
|
@ -9,6 +9,8 @@ from src import app
|
||||||
|
|
||||||
class TestApp(TestCase):
|
class TestApp(TestCase):
|
||||||
"""Unit test class to test other methods in the app."""
|
"""Unit test class to test other methods in the app."""
|
||||||
|
|
||||||
|
"""create symlink"""
|
||||||
def test_symlink_correct(self):
|
def test_symlink_correct(self):
|
||||||
os.mknod(os.path.join("./","testFile1.txt"))
|
os.mknod(os.path.join("./","testFile1.txt"))
|
||||||
app.symlink_force(os.path.join("./","testFile1.txt"),os.path.join("./","link_testFile1.txt"))
|
app.symlink_force(os.path.join("./","testFile1.txt"),os.path.join("./","link_testFile1.txt"))
|
||||||
|
@ -22,6 +24,11 @@ class TestApp(TestCase):
|
||||||
app.symlink_force(os.path.join("./","testFile2.txt"),os.path.join("./","link_testFile2.txt"))
|
app.symlink_force(os.path.join("./","testFile2.txt"),os.path.join("./","link_testFile2.txt"))
|
||||||
os.remove(os.path.join("./","testFile2.txt"))
|
os.remove(os.path.join("./","testFile2.txt"))
|
||||||
os.remove(os.path.join("./","link_testFile2.txt"))
|
os.remove(os.path.join("./","link_testFile2.txt"))
|
||||||
|
|
||||||
|
"""test if other exception pop"""
|
||||||
|
def test_symlink_other_except(self):
|
||||||
|
with self.assertRaises(Exception):
|
||||||
|
app.symlink_force(os.path.join("./","testFile3.txt"),os.path.join("./","link_testFile3.txt"))
|
||||||
|
|
||||||
def test_valid_env(self):
|
def test_valid_env(self):
|
||||||
key = 'ENV_1'
|
key = 'ENV_1'
|
||||||
|
|
Loading…
Reference in a new issue