Skip to content
Snippets Groups Projects
Commit c90fc078 authored by dh00601's avatar dh00601
Browse files

fixing tests

parent 01f20e58
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@ TODO: Before running the non-unit tests to cover functions like evolve, we need
import os
import sys
import json
import gzip
import unittest
from binarycpython.utils.functions import (
......@@ -343,7 +344,9 @@ class test_export_all_info(unittest.TestCase):
# datadir
settings_filename = test_pop.export_all_info(use_datadir=True)
self.assertTrue(os.path.isfile(settings_filename))
with open(settings_filename, "r") as f:
# We currently export the file as a gzip file so we need to take that into accoutn
with gzip.open(settings_filename, "rb") as f:
all_info = json.loads(f.read())
#
......
......@@ -666,14 +666,16 @@ class dataIO:
def NFS_flush_hack(self, filename):
"""
Use opendir()/closedir() to flush NFS access to a file.
NOTE: this may or may not work!
TODO: This function leads to a complaint about unclosed scandir operators. Check if that can be resolved.
"""
os.sync()
dirname = os.path.dirname(filename)
os.scandir(dirname)
os.scandir.close()
for _ in os.scandir(dirname):
pass
def compression_type(self, filename):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment