Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TEP014] Added HDFWriter class + Unit Tests #744

Merged
merged 6 commits into from
Jun 20, 2017
Merged
Changes from 1 commit
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
13 changes: 13 additions & 0 deletions tardis/io/tests/test_HDFWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,16 @@ def test_objects_write(tmpdir, attr):
fname, key='/test/mock_class/nested_object/property')
assert_array_almost_equal(
actual.nested_object.property, nested_property)


def test_snake_case():
obj = MockHDF(None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need this line because convert_to_snake_case is a static method. You can simply write MockHDF.convert_to_snake_case(...)

assert obj.convert_to_snake_case(
"HomologousDensity") == "homologous_density"
assert obj.convert_to_snake_case("TARDISSpectrum") == "tardis_spectrum"
assert obj.convert_to_snake_case("BasePlasma") == "base_plasma"
assert obj.convert_to_snake_case("LTEPlasma") == "lte_plasma"
assert obj.convert_to_snake_case(
"MonteCarloRunner") == "monte_carlo_runner"
assert obj.convert_to_snake_case(
"homologous_density") == "homologous_density"