Skip to content

Commit

Permalink
Remove config code changes that appear in a different PR
Browse files Browse the repository at this point in the history
  • Loading branch information
ekilmer committed Mar 2, 2021
1 parent 11066d7 commit b2f057b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 11 deletions.
4 changes: 0 additions & 4 deletions manticore/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,6 @@ def add(self, name: str, default=None, description: str = None):
"""
if name in self._vars:
# Be kind when double-adding the same exact config
existing = self._vars[name]
if default == existing.default and description == existing.description:
return
raise ConfigError(f"{self.name}.{name} already defined.")

if name == "name":
Expand Down
1 change: 0 additions & 1 deletion manticore/wasm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from ..utils import config

consts = config.get_group("cli")
consts.add("profile", default=False, description="Enable worker profiling mode")
consts.add("target_func", default="main", description="WASM Function to execute")


Expand Down
7 changes: 1 addition & 6 deletions tests/other/utils/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,12 @@ def test_default_vars(self):
self.assertFalse(g._vars["val1"].was_set)
self.assertTrue(g._vars["val2"].was_set)

def test_double_add_different(self):
def test_double_add(self):
g = config.get_group("test1")
g.add("val1", default="foo")
with self.assertRaises(config.ConfigError):
g.add("val1")

def test_double_add_exact_duplicate(self):
g = config.get_group("test2")
g.add("val1", default="foo", description="Some description")
g.add("val1", default="foo", description="Some description")

def test_update(self):
g = config.get_group("update")
g.add("val", default="default", description="description")
Expand Down
1 change: 1 addition & 0 deletions tests/wasm/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def test_implicit_call(self):
self.assertEqual(sorted(results), [70])

def test_wasm_main(self):
config.get_group("cli").add("profile", False)
m = wasm_main(
namedtuple("Args", ["argv", "workspace", "policy"])([collatz_file], "mcore_tmp", "ALL"),
None,
Expand Down

0 comments on commit b2f057b

Please sign in to comment.