once using os.getcwd() commond in the test case, it will report the below error: FIXTURES_DIR = os.path.join(os.getcwd(), 'tests/request_fixtures')
OSError: [Errno 2] No such file or directory
Find a substitutional method to get current working directory.
Change-Id: Ib313f51e8ce9770d67186554e397fb0a82c49fc8
import sys
from common import OscTestCase
-FIXTURES_DIR = os.path.join(os.getcwd(), 'tests/addfile_fixtures')
-
+#FIXTURES_DIR = os.path.join(os.getcwd(), 'addfile_fixtures')
+FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'addfile_fixtures')
def suite():
import unittest
return unittest.makeSuite(TestAddFiles)
import urllib2
from common import GET, PUT, POST, DELETE, OscTestCase
from xml.etree import cElementTree as ET
-FIXTURES_DIR = os.path.join(os.getcwd(), 'tests/commit_fixtures')
+#FIXTURES_DIR = os.path.join(os.getcwd(), 'commit_fixtures')
+FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'commit_fixtures')
def suite():
import unittest
import os
-FIXTURES_DIR = os.path.join(os.getcwd(), 'tests/conf_fixtures')
-
+#FIXTURES_DIR = os.path.join(os.getcwd(), 'conf_fixtures')
+FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'conf_fixtures')
def suite():
import unittest
return unittest.makeSuite(TestConf)
import os
from common import OscTestCase
-FIXTURES_DIR = os.path.join(os.getcwd(), 'tests/deletefile_fixtures')
+#FIXTURES_DIR = os.path.join(os.getcwd(), 'deletefile_fixtures')
+FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'deletefile_fixtures')
def suite():
import unittest
import re
from common import GET, OscTestCase
-FIXTURES_DIR = os.path.join(os.getcwd(), 'tests/difffile_fixtures')
-
+#FIXTURES_DIR = os.path.join(os.getcwd(), 'difffile_fixtures')
+FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'difffile_fixtures')
def suite():
import unittest
return unittest.makeSuite(TestDiffFiles)
import osc.oscerr
import os
from common import OscTestCase
-FIXTURES_DIR = os.path.join(os.getcwd(), 'tests/init_package_fixtures')
+#FIXTURES_DIR = os.path.join(os.getcwd(), 'init_package_fixtures')
+FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'init_package_fixtures')
def suite():
import unittest
import osc.oscerr
import os
from common import GET, OscTestCase
-FIXTURES_DIR = os.path.join(os.getcwd(), 'tests/init_project_fixtures')
+
+#FIXTURES_DIR = os.path.join(os.getcwd(), 'init_project_fixtures')
+FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'init_project_fixtures')
def suite():
import unittest
import os
from common import OscTestCase
-FIXTURES_DIR = os.path.join(os.getcwd(), 'tests/project_package_status_fixtures')
-
+#FIXTURES_DIR = os.path.join(os.getcwd(), 'project_package_status_fixtures')
+FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'project_package_status_fixtures')
def suite():
import unittest
return unittest.makeSuite(TestPackageStatus)
from common import GET, POST, OscTestCase, addExpectedRequest, EXPECTED_REQUESTS
-FIXTURES_DIR = os.path.join(os.getcwd(), 'tests/prdiff_fixtures')
+#FIXTURES_DIR = os.path.join(os.getcwd(), 'prdiff_fixtures')
+FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'prdiff_fixtures')
+
API_URL = 'http://localhost/'
UPSTREAM = 'some:project'
BRANCH = 'home:user:branches:' + UPSTREAM
import os
from common import OscTestCase
-FIXTURES_DIR = os.path.join(os.getcwd(), 'tests/project_package_status_fixtures')
+#FIXTURES_DIR = os.path.join(os.getcwd(), 'project_package_status_fixtures')
+FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'project_package_status_fixtures')
def suite():
import unittest
import sys
from common import GET, PUT, POST, DELETE, OscTestCase
from xml.etree import cElementTree as ET
-FIXTURES_DIR = os.path.join(os.getcwd(), 'tests/repairwc_fixtures')
+#FIXTURES_DIR = os.path.join(os.getcwd(), 'repairwc_fixtures')
+FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'repairwc_fixtures')
def suite():
import unittest
import os
from common import OscTestCase
-FIXTURES_DIR = os.path.join(os.getcwd(), 'tests/request_fixtures')
+#FIXTURES_DIR = os.path.join(os.getcwd(), 'request_fixtures')
+FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'request_fixtures')
def suite():
import unittest
import os
from common import OscTestCase
-FIXTURES_DIR = os.path.join(os.getcwd(), 'tests/revertfile_fixtures')
+#FIXTURES_DIR = os.path.join(os.getcwd(), 'revertfile_fixtures')
+FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'revertfile_fixtures')
def suite():
import unittest
import osc.oscerr
import os
from common import GET, PUT, OscTestCase
-FIXTURES_DIR = os.path.join(os.getcwd(), 'tests/setlinkrev_fixtures')
+#FIXTURES_DIR = os.path.join(os.getcwd(), 'setlinkrev_fixtures')
+FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'setlinkrev_fixtures')
def suite():
import unittest
import os
import sys
from common import GET, OscTestCase
-FIXTURES_DIR = os.path.join(os.getcwd(), 'tests/update_fixtures')
+
+#FIXTURES_DIR = os.path.join(os.path.dirname(os.getcwd(), 'update_fixtures')
+FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'update_fixtures')
def suite():
import unittest