Commit 11f1c880 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

use $(abs_srcdir) instead of hardcoded path to test data to make it

distcheck friendly.
this may be a bit non trivial, but I'mgoing to push without a review
as this has been causing buildbot errors.
parent 681cb466
......@@ -15,5 +15,6 @@ endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/python/isc/log \
TESTDATA_PATH=$(abs_srcdir)/testdata \
$(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
......@@ -14,10 +14,11 @@
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
from isc.datasrc import sqlite3_ds
import os
import socket
import unittest
TEST_DATA_PATH = "./testdata/"
TESTDATA_PATH = os.environ['TESTDATA_PATH'] + os.sep
class TestSqlite3_ds(unittest.TestCase):
def test_zone_exist(self):
......@@ -32,11 +33,11 @@ class TestSqlite3_ds(unittest.TestCase):
# Open a broken database file
self.assertRaises(sqlite3_ds.Sqlite3DSError,
sqlite3_ds.zone_exist, "example.com",
TEST_DATA_PATH + "brokendb.sqlite3")
TESTDATA_PATH + "brokendb.sqlite3")
self.assertTrue(sqlite3_ds.zone_exist("example.com.",
TEST_DATA_PATH + "example.com.sqlite3"))
TESTDATA_PATH + "example.com.sqlite3"))
self.assertFalse(sqlite3_ds.zone_exist("example.org.",
TEST_DATA_PATH + "example.com.sqlite3"))
TESTDATA_PATH + "example.com.sqlite3"))
if __name__ == '__main__':
unittest.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment