-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing out test files.
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from .OC_plot import calculate_oc | ||
|
||
|
||
def test_calculate_oc(): | ||
# Test case 1: Test when T0 = 0 | ||
m = 10.0 | ||
err = 0.1 | ||
T0 = 0 | ||
T0_err = 0.1 | ||
p = 1.0 | ||
e, OC, OC_err, T0, T0_err = calculate_oc(m, err, T0, T0_err, p) | ||
assert e == 10.0 | ||
assert OC == "0.00000" | ||
assert OC_err == "0.14142" | ||
|
||
# Test case 2: Test when T0 != 0 | ||
m = 15.0 | ||
err = 0.1 | ||
T0 = 5.0 | ||
T0_err = 0.1 | ||
p = 2.0 | ||
e, OC, OC_err, T0, T0_err = calculate_oc(m, err, T0, T0_err, p) | ||
assert e == 5.0 | ||
assert OC == "0.00000" | ||
assert OC_err == "0.14142" |