From aa16ef82f6a563ed6e045f28a6f392c39e5af891 Mon Sep 17 00:00:00 2001 From: Farrah Molina Date: Fri, 27 Sep 2024 13:39:00 -0500 Subject: [PATCH] Added assert brightness test --- tests/test_brightness.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/test_brightness.py b/tests/test_brightness.py index 58fba946..7d6af83d 100644 --- a/tests/test_brightness.py +++ b/tests/test_brightness.py @@ -64,6 +64,22 @@ def test_read_input_with_brightness(): # TODO (Farrah): add a test that asserts the brightness column of the data table is # what you expect (hint: check in the reflected_light_example.csv to see what # the brightness values should be +def test_assert_brightness(): + + num_secondary_bodies = 1 + + input_file = os.path.join(DATADIR, "reflected_light_example.csv") + + data_table = read_input.read_file(input_file) + + brightness_values = data_table["brightness"].value + assert 'brightness' in data_table.columns, "Brightness column does not exist" + print("The assert works!") + print (brightness_values) + x = "welcome" + + #if condition returns False, AssertionError is raised: + assert x != "hello", "This is meant to say welcome" def test_compute_posteriors(): @@ -112,5 +128,6 @@ def test_compute_posteriors(): if __name__ == "__main__": # test_brightness_calculation() - test_read_input_with_brightness() + #test_read_input_with_brightness() + test_assert_brightness() # test_compute_posteriors()