Skip to content

Commit 033829f

Browse files
author
Daniil Galahov
committed
Improved tests (maked them portable for GitHub CI workflow)
Signed-off-by: Daniil Galahov <daniil.galahov@yandex.ru>
1 parent 6343132 commit 033829f

4 files changed

Lines changed: 24 additions & 11 deletions

File tree

tests/test_archive.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import sys
2-
sys.path.append("..\src")
1+
import sys, os
2+
3+
currentDir = os.path.dirname(__file__)
4+
sourceDir = os.path.abspath(os.path.join(currentDir, "..", "src"))
5+
if sourceDir not in sys.path:
6+
sys.path.append(sourceDir)
37

4-
import os
58
import hashlib
69
import archive
710
import unittest

tests/test_rbs.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import sys
2-
sys.path.append("..\src")
1+
import sys, os
2+
3+
currentDir = os.path.dirname(__file__)
4+
sourceDir = os.path.abspath(os.path.join(currentDir, "..", "src"))
5+
if sourceDir not in sys.path:
6+
sys.path.append(sourceDir)
37

4-
import os
58
import rbs
69
import unittest
710

tests/test_repo.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import sys
2-
sys.path.append("..\src")
1+
import sys, os
2+
3+
currentDir = os.path.dirname(__file__)
4+
sourceDir = os.path.abspath(os.path.join(currentDir, "..", "src"))
5+
if sourceDir not in sys.path:
6+
sys.path.append(sourceDir)
37

4-
import os
58
from datetime import datetime
69
import shutil
710
from repo import Repo

tests/test_utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
import sys
2-
sys.path.append("..\src")
1+
import sys, os
2+
3+
currentDir = os.path.dirname(__file__)
4+
sourceDir = os.path.abspath(os.path.join(currentDir, "..", "src"))
5+
if sourceDir not in sys.path:
6+
sys.path.append(sourceDir)
37

48
from utils import FixPath
59
import unittest

0 commit comments

Comments
 (0)