Skip to content

Commit

Permalink
FunctionMetadata: Remove param type asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
sils committed May 16, 2015
1 parent 5d5766d commit 281b170
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
11 changes: 0 additions & 11 deletions coalib/settings/FunctionMetadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@ def __init__(self,
if optional_params is None:
optional_params = {}

if not isinstance(name, str):
raise TypeError("name should be a string")
if not isinstance(desc, str):
raise TypeError("desc should be a string")
if not isinstance(retval_desc, str):
raise TypeError("retval_desc should be a string")
if not isinstance(non_optional_params, dict):
raise TypeError("non_optional_params should be a dict")
if not isinstance(optional_params, dict):
raise TypeError("optional_params should be a dict")

self.name = name
self.desc = desc
self.retval_desc = retval_desc
Expand Down
16 changes: 0 additions & 16 deletions coalib/tests/settings/FunctionMetadataTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,6 @@ def bad_function(self, bad_param: "no function"):

class FunctionMetadataTest(unittest.TestCase):
def test_construction(self):
self.assertRaises(TypeError, FunctionMetadata, 5)
self.assertRaises(TypeError, FunctionMetadata, "name", desc=5)
self.assertRaises(TypeError, FunctionMetadata, "name", retval_desc=5)
self.assertRaises(TypeError,
FunctionMetadata,
"name",
non_optional_params=5)
self.assertRaises(TypeError,
FunctionMetadata,
"name",
optional_params=5)
self.assertRaises(TypeError, FunctionMetadata.from_function, 5)
self.assertRaises(TypeError,
FunctionMetadata.from_function,
self.test_construction,
5)
self.check_function_metadata_data_set(FunctionMetadata("name"), "name")

def test_from_function(self):
Expand Down

0 comments on commit 281b170

Please sign in to comment.