Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ def test_input_output_keys():
k, v = line.split('\t')
key = json.loads(k)
value = json.loads(v)
compiler.Add(key, value)
compiler.add(key, value)
input_keys_count += 1

output_keys_count = 0
with tmp_dictionary(compiler, 'var_length_short_test.kv') as d:
for _ in d.GetAllItems():
for _ in d.items():
output_keys_count += 1

assert input_keys_count == output_keys_count
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def memory_usage_ps():

def test_leak():
c = JsonDictionaryCompiler({"memory_limit_mb":"10"})
c.Add("something", '["a" : 2]')
c.add("something", '["a" : 2]')

with tmp_dictionary(c, 'near_simple.kv') as d:
gc.collect()
Expand Down
16 changes: 8 additions & 8 deletions python/tests/dictionary/loading_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ def test_truncated_file_json():
c.write_to_file(os.path.join(tmp_dir,'truncation_test.kv'))
size = os.path.getsize(os.path.join(tmp_dir, 'truncation_test.kv'))

fd_in = open(os.path.join(tmp_dir,'truncation_test.kv'), 'rb')
fd = open(os.path.join(tmp_dir,'truncation_test1.kv'), 'wb')
fd.write(fd_in.read(int(size/2)))
fd.close()

fd2 = open(os.path.join(tmp_dir,'truncation_test2.kv'), 'wb')
fd2.write(fd_in.read(int(size-2)))
fd2.close()
with open(os.path.join(tmp_dir,'truncation_test.kv'), 'rb') as fd_in:
fd = open(os.path.join(tmp_dir,'truncation_test1.kv'), 'wb')
fd.write(fd_in.read(int(size/2)))
fd.close()

fd2 = open(os.path.join(tmp_dir,'truncation_test2.kv'), 'wb')
fd2.write(fd_in.read(int(size-2)))
fd2.close()

with pytest.raises(ValueError):
d=Dictionary(os.path.join(tmp_dir, 'truncation_test1.kv'))
Expand Down
2 changes: 1 addition & 1 deletion python/tests/index/merger_binary_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@

def test_merger_binary():
cmd = get_interpreter_executable() + b" " + os.path.join(get_package_root(), b"_pycore" , b"keyvimerger.py") + b" -h"
rc = subprocess.call(cmd, shell=True, stdout=open(os.devnull, 'w'))
rc = subprocess.call(cmd, shell=True)
assert rc == 0
Loading