Skip to content

Commit

Permalink
Fix test_DBfile when called by itself
Browse files Browse the repository at this point in the history
 * Was only working when called as part of test_all
  • Loading branch information
jtniehof authored and dnadeau-lanl committed Mar 3, 2021
1 parent 80d12b5 commit 142a497
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions unit_tests/test_DBfile.py
Expand Up @@ -7,6 +7,7 @@
import os
import tempfile

import dbp_testing
from dbprocessing import DBfile
from dbprocessing import DButils
from dbprocessing import Diskfile
Expand All @@ -18,10 +19,10 @@ class DBfileTests(unittest.TestCase):
def setUp(self):
super(DBfileTests, self).setUp()
self.tempD = tempfile.mkdtemp()
copy_tree(os.path.dirname(__file__) + '/../functional_test/', self.tempD)
copy_tree(os.path.dirname(__file__) + '/tars/', self.tempD)
copy_tree(os.path.join(dbp_testing.testsdir, '..', 'functional_test'), self.tempD)
copy_tree(os.path.join(dbp_testing.testsdir, 'tars'), self.tempD)

self.dbu = DButils.DButils(self.tempD + '/testDB.sqlite')
self.dbu = DButils.DButils(os.path.join(self.tempD, 'testDB.sqlite'))
#Update the mission path to the tmp dir
self.dbu.getEntry('Mission', 1).rootdir = self.tempD
self.dbu.commitDB()
Expand Down

0 comments on commit 142a497

Please sign in to comment.