From e7145d4591f0a46990a718c2884adc634bd24d86 Mon Sep 17 00:00:00 2001 From: JanLJL Date: Thu, 10 Oct 2019 17:59:11 +0200 Subject: [PATCH] fixed testing --- osaca/db_interface.py | 4 ++-- tests/test_db_interface.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osaca/db_interface.py b/osaca/db_interface.py index 896da0a..26f4d8b 100755 --- a/osaca/db_interface.py +++ b/osaca/db_interface.py @@ -43,7 +43,7 @@ def add_entry_to_db(arch: str, entry): data['instruction_forms'].append(entry) # __dump_data_to_yaml(filepath, data) with open(filepath, 'w') as f: - yaml.dump(data) + yaml.dump(data, f) def add_entries_to_db(arch: str, entries: list) -> None: @@ -86,7 +86,7 @@ def add_entries_to_db(arch: str, entries: list) -> None: data['instruction_forms'].append(entry) # __dump_data_to_yaml(filepath, data) with open(filepath, 'w') as f: - yaml.dump(data) + yaml.dump(data, f) def sanity_check(arch: str, verbose=False): diff --git a/tests/test_db_interface.py b/tests/test_db_interface.py index a585b02..7b7b3b3 100755 --- a/tests/test_db_interface.py +++ b/tests/test_db_interface.py @@ -8,7 +8,7 @@ import os import sys import unittest -from osaca.api import add_entries_to_db, add_entry_to_db, sanity_check +from osaca.db_interface import add_entries_to_db, add_entry_to_db, sanity_check from osaca.semantics import MachineModel @@ -39,7 +39,7 @@ class TestDBInterface(unittest.TestCase): def tearDownClass(self): if sys.exc_info() == (None, None, None): # Test successful, remove DB entries - test_archs = {'csx': 22, 'vulcan': 24, 'zen1': 22} + test_archs = {'csx': 54, 'vulcan': 57, 'zen1': 58} for arch in test_archs: lines = [] with open(os.path.expanduser('~/.osaca/data/' + arch + '.yml'), 'r') as f: