Skip to content

Commit

Permalink
Updates to allow files to run on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Vedant P Iyer committed Sep 5, 2024
1 parent 2ea5be4 commit 38c1ccb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions dsi/backends/tests/test_sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_wildfire_data_sql_artifact():
assert True

def test_wildfire_data_csv_artifact():
csvpath = '/'.join([get_git_root('.'), 'dsi/data/wildfiredata.csv'])
csvpath = '/'.join([get_git_root('.'), '../examples/data/wildfiredata.csv'])
dbpath = "wildfire.db"
store = Sqlite(dbpath)
store.put_artifacts_csv(csvpath, "simulation", isVerbose=isVerbose)
Expand Down Expand Up @@ -60,7 +60,7 @@ def test_jsondata_artifact_put():
assert True

def test_yosemite_data_csv_artifact():
csvpath = '/'.join([get_git_root('.'), 'dsi/data/yosemite5.csv'])
csvpath = '/'.join([get_git_root('.'), '../examples/data/yosemite5.csv'])
dbpath = "yosemite.db"
store = Sqlite(dbpath)
store.put_artifacts_csv(csvpath, "vision", isVerbose=isVerbose)
Expand All @@ -87,8 +87,8 @@ def test_artifact_query():

def test_yaml_reader():
reader = Sqlite("yaml-test.db")
reader.yamlToSqlite("../../../examples/data/schema.yml", "yaml-test", deleteSql=False)
subprocess.run(["diff", "../../../examples/data/compare-schema.sql", "yaml-test.sql"], stdout=open("compare_sql.txt", "w"))
reader.yamlToSqlite("../examples/data/schema.yml", "yaml-test", deleteSql=False)
subprocess.run(["diff", "../examples/data/compare-schema.sql", "yaml-test.sql"], stdout=open("compare_sql.txt", "w"))
file_size = os.path.getsize("compare_sql.txt")
os.remove("compare_sql.txt")
os.remove("yaml-test.sql")
Expand All @@ -98,8 +98,8 @@ def test_yaml_reader():

def test_toml_reader():
reader = Sqlite("toml-test.db")
reader.tomlToSqlite("../../../examples/data/schema.toml", "toml-test", deleteSql=False)
subprocess.run(["diff", "../../../examples/data/compare-schema.sql", "toml-test.sql"], stdout=open("compare_sql.txt", "w"))
reader.tomlToSqlite("../examples/data/schema.toml", "toml-test", deleteSql=False)
subprocess.run(["diff", "../examples/data/compare-schema.sql", "toml-test.sql"], stdout=open("compare_sql.txt", "w"))
file_size = os.path.getsize("compare_sql.txt")
os.remove("compare_sql.txt")
os.remove("toml-test.sql")
Expand Down
2 changes: 1 addition & 1 deletion dsi/plugins/file_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, filenames, **kwargs):

def export_erd(self, dbname, fname):
"""
Function that outputs a dot file for the given database.
Function that outputs a ER diagram for the given database.
`dbname`: database to create an ER diagram for
Expand Down
4 changes: 2 additions & 2 deletions dsi/tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def test_export_db_erd():
connection.close()

er_image = cv2.imread("test1.png")
pixel_mean = np.mean(er_image)

assert er_image is not None #check if image generated at all

pixel_mean = np.mean(er_image)
os.remove("test1.png")
assert pixel_mean != 255 #check if image is all white pixels (no diagram generated)

0 comments on commit 38c1ccb

Please sign in to comment.