Fix test case in reader_ops_test

This commit is contained in:
Fred Reiss 2019-08-12 15:50:20 -07:00
parent d0ed82209b
commit b62adedf42

View File

@ -22,6 +22,7 @@ import collections
import gzip
import os
import shutil
import sys
import threading
import zlib
@ -754,7 +755,10 @@ class LMDBReaderTest(test.TestCase):
def setUp(self):
super(LMDBReaderTest, self).setUp()
# Copy database out because we need the path to be writable to use locks.
path = os.path.join(prefix_path, "lmdb", "testdata", "data.mdb")
# The on-disk format of an LMDB file is different on big-endian machines,
# because LMDB is a memory-mapped database.
db_file = "data.mdb" if sys.byteorder == "little" else "data_bigendian.mdb"
path = os.path.join(prefix_path, "lmdb", "testdata", db_file)
self.db_path = os.path.join(self.get_temp_dir(), "data.mdb")
shutil.copy(path, self.db_path)