-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add __str__ method to dss_type (#46)
* add __str__ method to dss_type other houskeeping * cleanup * oops
- Loading branch information
Showing
5 changed files
with
25 additions
and
5 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[metadata] | ||
name = hecdss | ||
version = 0.1.15 | ||
version = 0.1.16 | ||
author = Hydrologic Engineering Center | ||
author_email [email protected] | ||
description = Python wrapper for the HEC-DSS file database C library. | ||
|
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
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 |
---|---|---|
|
@@ -12,3 +12,5 @@ class DssType(Enum): | |
PER_MIN = "PER-MIN" | ||
CONST = "CONST" | ||
|
||
def __str__(self): | ||
return self.value |
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,18 @@ | ||
import unittest | ||
import os | ||
import sys | ||
|
||
sys.path.append(r'src') | ||
sys.path.append(os.path.dirname(__file__)) | ||
from hecdss.dss_type import DssType | ||
|
||
|
||
class TestBasics(unittest.TestCase): | ||
|
||
|
||
def test_to_string(self): | ||
""" This is testing the __str__ method in DssType """ | ||
t = DssType.PER_CUM | ||
s = str(t) | ||
assert s == "PER-CUM", f"actual:{s}, expected 'PER-CUM'" | ||
|
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