Skip to content

Commit

Permalink
update database with graphites and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trappitsch committed Jul 11, 2024
1 parent 177af9f commit 9d786d8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions docs/users/db.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ Note that all databases,
i.e., for all different grain types ("sic", ...)
can be managed with this tool.

## Currently impelmented databases

The following grain types are currently implemented:

- `"sic"`: Silicon carbide
- `"gra"`: Graphite

## Background

In order to be able to update the database without updating the package,
Expand Down
2 changes: 1 addition & 1 deletion tests/data_files/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
}
]
},
"graphites": {
"gra": {
"db_name": "Graphite",
"versions":[
{
Expand Down
2 changes: 1 addition & 1 deletion tests/test_db/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def conf_files(tmpdir_home, data_files_dir) -> Path:
@pytest.fixture
def current_file(tmpdir_home) -> Tuple[Path, dict]:
"""Create a fake `current.json` file and write into the right location."""
curr_to_write = {"sic": "test.csv", "graphites": "test-graphites.csv"}
curr_to_write = {"sic": "test.csv", "gra": "test-graphites.csv"}
curr_ret = {k: Path(v) for k, v in curr_to_write.items()}

with open(tmpdir_home.joinpath("current.json"), "w") as fout:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_db/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_databases_conf_not_found():
def test_databases_dbs(conf_files):
"""Assert that the database reader returns all databases when asked."""
db = DataBases()
assert db.dbs == ["sic", "graphites"]
assert db.dbs == ["sic", "gra"]


def test_databases_urls_all(conf_files):
Expand Down

0 comments on commit 9d786d8

Please sign in to comment.